Page 1 of 1
What am I doing wrong?
Posted:
Tue Sep 27, 2011 8:51 pm
by beginnerirvaz
I have a button on screen when pressed I have a menu appear on screen. I created a actor called menu out of the view, and on the button I have a mouse down - move to and put the x and y. My menu appears on screen when pressed. My problem is when I add 2 actors on top of the menu to be used as buttons I can't get them to follow the menu. I made menu the parent for both but when the button is pressed they don't follow?
Any ideas?
Thanks
Irvaz
Re: What am I doing wrong?
Posted:
Tue Sep 27, 2011 10:06 pm
by NERDnotGEEK
Its more than likely a simple mistake you have made. Can you send me/ upload the game and ill have a look at it? otherwise ill just be taking random guesses at what you may have done wrong.
Re: What am I doing wrong?
Posted:
Wed Sep 28, 2011 3:53 am
by RippeR7420
Try to draw your menu with the buttons on it in one .png and use filled regions for your mouse button down events. Make the filled regions a child to the view(view is parent of filled regions) then disable filled regions, and enabled them when you click the button to make your menu appear. Just an idea. Hope it helps!
Re: What am I doing wrong?
Posted:
Wed Sep 28, 2011 12:41 pm
by beginnerirvaz
Hey thanks for the replys.
I made a menu actor off screen and button1 and button 2 actors above this. In my menu actor I draw actor- script- and typed -
button1.x=x-175;
button1.y=y;
button2.x=x+175;
button2.y=y;
I made a button on screen with - mouse button down- move to left- actor menu relative to game centre position x240 y150 velocity 1000.
Now this works great, once clicked my menu appears with both buttons on top. However I have now tried to add a mouse down to both buttons and have another menu appear but I get nothing, even though I do exactly the same as the original screen button. I'm lost, any ideas?
Thanks
Re: What am I doing wrong?
Posted:
Wed Sep 28, 2011 1:49 pm
by NERDnotGEEK
First thing. Why use move to? why not just set its x and y values on the mouse down? x= 240 y = 150. Why bother with a move to function at 1000 velocity?
Second thing. YOUR PROBLEM IS YOUR CODE. Without your code no one can fix it without guessing every possible problem with what you have done. I really don't have time to guess the 101 possible ways that it could not work. but if you show me your code/game I do have time to tell you the 1 problem that you do have. Sorry if that's a rant but it seems like common sense to me.
Re: What am I doing wrong?
Posted:
Wed Sep 28, 2011 7:39 pm
by beginnerirvaz
Hey
I'm using a button to control another actor off screen, I assumed if I just used a mouse down and x= y= that this will only set the position of the button. Not the actual menu off screen. My button works and brings menu on screen with 2 more buttons, I just can't now get both of those buttons to do the same and bring a sought of sub menu. My code is above, thanks for the replys so far.
Re: What am I doing wrong?
Posted:
Wed Sep 28, 2011 11:59 pm
by NERDnotGEEK
On mouse down of button 1 (or 2)
- Code: Select all
submenu.x = x;
submenu.y = y;
That will make the submenu's x and y values = to the buttons x and y values. obviously you may want to + a few 100 on each to get it in the right place. but thats basically everything you need?