The problem when images using instead buttons

27 views
Skip to first unread message

DogPlanner GSS

unread,
May 29, 2026, 11:54:05 AM (yesterday) May 29
to DroidScript
Dear Developers,

we noticed one thing when we work with buttons, e.g.: 

btnBackMonth = app.CreateButton("Back Month", 0.2, 0.1);
btnBackMonth.SetOnTouch( btnBackMonth_OnTouch );
layHoriz.AddChild( btnBackMonth );

all is Ok!

But when we change button to the image, e.g.:

btnBackMonth = app.CreateImage("Img/back_btn.png", 0.2, 0.1);
btnBackMonth.SetOnTouch( btnBackMonth_OnTouch );
layHoriz.AddChild( btnBackMonth );

after pushing on image the function is executed 3 times.

Thank you very much in advance.

Have a nice day.

Best regards
Dmitry

Jumar

unread,
May 29, 2026, 12:50:06 PM (yesterday) May 29
to DroidScript
Hi

Try listening of touch up only like this:

btnBackMonth.SetOnTouchUp(btnBackMonth_OnTouch)

DogPlanner GSS

unread,
9:57 AM (6 hours ago) 9:57 AM
to DroidScript
Dear Jumar,

thank you very much for you help, we will try it! 
At this time we added the variable for checking how many times was function called (and limited this by 1 time).

Thank you again! Have a nice day and weekend.

Best regards
Dmitry

пятница, 29 мая 2026 г. в 19:50:06 UTC+3, Jumar:
Reply all
Reply to author
Forward
0 new messages