What am I doing wrong?

Game Editor comments and discussion.

What am I doing wrong?

Postby beginnerirvaz » Tue Sep 27, 2011 8:51 pm

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
beginnerirvaz
 
Posts: 37
Joined: Fri Sep 09, 2011 2:02 am
Score: 0 Give a positive score

Re: What am I doing wrong?

Postby NERDnotGEEK » Tue Sep 27, 2011 10:06 pm

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.
NERDnotGEEK
 
Posts: 75
Joined: Sat Oct 30, 2010 1:48 am
Score: 12 Give a positive score

Re: What am I doing wrong?

Postby RippeR7420 » Wed Sep 28, 2011 3:53 am

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! :)
CURRENT PROJECTS:

-Olo: The Sword Shaman http://game-editor.com/forum/viewtopic.php?f=4&t=12919

-The Wrath of Blob: (On the back burner)

-StickMcGee - Blast to the Future http://game-editor.com/forum/viewtopic.php?f=4&t=13660
User avatar
RippeR7420
 
Posts: 391
Joined: Mon Apr 27, 2009 4:16 pm
Location: Salt Lake City, Utah.
Score: 23 Give a positive score

Re: What am I doing wrong?

Postby beginnerirvaz » Wed Sep 28, 2011 12:41 pm

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
beginnerirvaz
 
Posts: 37
Joined: Fri Sep 09, 2011 2:02 am
Score: 0 Give a positive score

Re: What am I doing wrong?

Postby NERDnotGEEK » Wed Sep 28, 2011 1:49 pm

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.
NERDnotGEEK
 
Posts: 75
Joined: Sat Oct 30, 2010 1:48 am
Score: 12 Give a positive score

Re: What am I doing wrong?

Postby beginnerirvaz » Wed Sep 28, 2011 7:39 pm

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.
beginnerirvaz
 
Posts: 37
Joined: Fri Sep 09, 2011 2:02 am
Score: 0 Give a positive score

Re: What am I doing wrong?

Postby NERDnotGEEK » Wed Sep 28, 2011 11:59 pm

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?
NERDnotGEEK
 
Posts: 75
Joined: Sat Oct 30, 2010 1:48 am
Score: 12 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest