Button

add button widget in the SgneepBox IDE.

use snippet directly from ID and select button type:

sgneepbox button script snippet

Features: double state, call to external script

command:

button_xy *id *x *y

*X *Y = set screen axis


button_dim *id *width *height

*W *H = width and height of the imahe button


button_img *id *image

*image = load image.jpg in button ( unpress state )


button_call *id *subscript

*subscript = call to SgneepBox subscript( unpress state )


button_press *id *image.jpg

*image = load image.jpg in button ( press state )


button_unpress_call *id *subscript

*subscript = call to SgneepBox subscript


button_run *id

run and view button ID


button_close *id

close button by id name


button_close_all

close all button


Example

# set subroutine function:
make_sub myimg
sub myimg photo_now 640x480 myphoto
# set button named but_A
button_xy but_A 10 10
button_dim but_A 150 150
button_img but_A do.png
button_call but_A play_sound
button_run but_A
# subroutine function:
make_sub play_sound
sub play_sound mp3_load test.mp3
end_script
Powered by Sgneep.com