Stride Forums Archive

Properly use UI Buttons

2 posts, 1723 views, 2017-10-12 to 2017-10-12

Horizon_Games_Studio (Horizon Games Studio) 2017-10-12 #1

Hello everyone,
i’m just trying to catch the event “ispressed” from a button child of a canvas.
i tried:
var buttonExit = main.Page.RootElement.FindVisualChildOfType<Panel>("CanMain").FindVisualChildOfType<Button>("ButtonExit");
But nothing happened.

Horizon_Games_Studio (Horizon Games Studio) 2017-10-12 #2

Fixed it by myself because of my mistake.

I had 2 canvas with the same behaviour, the one without script was behind the other.
So, i couldn’t call the method because of a button behind the true one.

Feel free to close or delete this post.