Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: entities inside of windows  (Read 3230 times)

0 Members and 1 Guest are viewing this topic.

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
entities inside of windows
« on: October 30, 2007, 02:28:44 PM »

i am experimenting with an automap for schach-welten

so i have the main window "automap"
inside is an entity for the background "map_back" ( entity because i want to animate it )
and a nested window "map_buttons"
which contains all the buttons "1","2","3" etc. for the map pieces
and another entity "map_front" for the preview pictures of the map buttons

now i am altering the map_front by a script that checks a global variable called "automap" via while (true) loop
the autmap is ste to a number by the buttons ( on MouseEntry and on MouseLeave )

everything is working (but i think it is not very well scripted ) except i want to fade in the preview pics in "map_front"
this isnt working.
it seems only alphavalues 0 and 255 are accepted. there is no fading inbetween.

so i tried it with a sprite for the entity - 15 frames slowly fading in
but the same result.
only alpha value 0 and 255 are displayed no inbetweens.

why is that so
and how can i change it if possible ??

best regards

stucki
 



Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: entities inside of windows
« Reply #1 on: October 30, 2007, 04:46:49 PM »

Now I'm confused. Can you make some small demo so that one can test it?
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: entities inside of windows
« Reply #2 on: October 30, 2007, 05:42:36 PM »

maybe this can help ...
here is the window.


when the mouse touches buttons "1" and "2" the image of "map_front" is changed.
i have a global variable "automap" which is set to 0 when the mouse is not on any button and to 1 or 2 if it is over one of the buttons [ every button has a script which checks MouseEntry and MouseLeave and sets "automap"
the entity map_front has a while (true) loop that changes its image according to the variable "automap"
thats all working.

now i want the image of "map_front" not to appear but to fade in and this is not working.
neither by script nor by sprite with 15 frames with changing alpha value...
its just alpha 0 and than alpha 255 - no inbetweens


here is the map_front script:

#include "scripts\base.inc"
var i;
while ( true)
   {
   if (automap !=0)
      {
      if (automap ==1) this.SetSprite ("interface/K4_1.sprite");
      else if (automap ==2) this.SetSprite ("interface/K4_2.png");
      /*this.AlphaColor = RGB (255,255,255,0);                                    // this was the non sprite approach
      for (i=0;i<=255;i=i+15)
         {
         this.AlphaColor = RGB (255,255,255,i);
         Sleep (60);
         }
         this.AlphaColor = RGB (255,255,255,255);
      */}
   else this.SetSprite ("interface/automap_front.png");
   Sleep (50);
   }

and here is a button script:

#include "scripts\base.inc"
////////////////////////////////////////////////////////////////////////////////
on "MouseEntry"
{
automap=1;
}
on "MouseLeave"
{
automap=0;
}

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: entities inside of windows
« Reply #3 on: October 30, 2007, 05:56:16 PM »

I would still prefer some small demo so that I can try it myself.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: entities inside of windows
« Reply #4 on: October 30, 2007, 07:03:46 PM »

okay i will prepare it.

anothe question: cant a button disable itself ?

i have this code in the button script:

if (mapaktuell=="K4_1")
   {
   this.SetImage ("interface/map_raum_1.png");
   this.Disabled=true;
   }
else
   {
   this.SetImage ("interface/map_raum.png");
   this.Disabled=false;
   }

the image changes but it always stays enabled ...

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: entities inside of windows
« Reply #5 on: October 30, 2007, 08:41:59 PM »

Well, yes, they certainly can. I don't see why this shouldn't work if the condition is met and the code is executed...
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.041 seconds with 23 queries.