Problem with buttons

Shishkov

  • Posts: 169
Hello everybody,

1) In my main menu by means of pressing one button, I create a filled rectangle and above it I want to place a button. When I try to do it, it is created beneath the rectangle rather than to be created above. I tried many ways like creating it at front, back, middle, but it was useless.
So what do you recommend and how it can be made out?

2) I have 2 buttons in my menu. If one button is pressed, for example, credits are shown. Another button is pressed, for instance, help is shown. I don't want to create scenes for these small events, so I decided to use filled rectangles above buttons for displaying these information. I have 2 global variables for buttons in behavior, one for displaying credits, another one for help. So when one of two buttons is pressed, in main menu scene can be shown help or credits info.
After that another button is created for return to main menu. When this button is pressed, I made 2 global variables False.
When it comes back to main menu in behavior, if help info is worked, I don't know why, credits info also is worked after closing help info.
When credits info is worked, everything is alright and nothing is actuated after it like it is described above.
What do you advise and how it can be solved?

Tuo

  • *
  • Posts: 2469
1. Draw behaviors trump normal actors most of the time. One way around this is to kinda turn the button itself into a drawing, telling it to "draw image for self" so that it will be on top.

2. Since you are using individual game attributes, be sure that you aren't accidentally setting the second one to true upon closing the first... although it was a bit hard to help with this without seeing the coding.
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

Shishkov

  • Posts: 169
1. I create this button in drawing event;
And how should I tell it?

2. I checked everywhere for their settings and it was OK. Also, I tried to debug and found out that in case help info is worked, it is set credits in behavior as if button credits is pressed and event is there after help info is closed.   
If credits work first - no problems.

Shishkov

  • Posts: 169
how can I "draw image for self" ?

Tuo

  • *
  • Posts: 2469
At this point, it'd probably be easier to upload it to StencylForge and make it public so that I can look at it directly to try to figure out what is going on.
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

Shishkov

  • Posts: 169
Thank you very much for your patience and desire to help.

Problem number 2 is solved.

But "draw image for self"  - was useless. What else can you recommend?

« Last Edit: February 27, 2013, 08:05:00 am by Shishkov »

Tuo

  • *
  • Posts: 2469
The "draw image for self" should be put into the drawing code for the button. Did you do that?
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

Shishkov

  • Posts: 169
I made this drawing code for menu through behaviour for button. Because I want to use one button actor with a lot of animation and work with it through behaviour code. So this drawing is happening in the main menu scene. I made an opacity 40%, so now it is pretty well and appealing to me.

Anyway it would be nice, if it was solved.

Thank you

Tuo

  • *
  • Posts: 2469
If you use the "draw image for self" inside of the button's coding, it will be its current animation, so it should work fine. I guess I'm confused at what the issue is. ???
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

Shishkov

  • Posts: 169
I used it "draw image for self" - in drawing code of the main menu for the last created actor: a button and exactly in the button.
And both ways were useless.

Tuo

  • *
  • Posts: 2469
I think the best way for me to help would be to see it directly via StencylForge (or you could email it to me).
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

Shishkov

  • Posts: 169
I'm sorry, but this game is approved on the FGL server and now it is active bidding.
However, game is alright and this problem is elusive.

But I have only 2 sponsor's view and no biddings. Would you mind advising something in order to attract more sponsors and earn something?

This is a youtube ID: tCloNeeNpMg

Tuo

  • *
  • Posts: 2469
Ah, to get views is pretty simple: make it flashy, especially the icon. That's unfortunately what it comes down to.
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)