Ecere SDK/eC Forums
http://ecere.org/community/
Print view

Code Snippet03--SplashWindow(Timer driven)
http://ecere.org/community/viewtopic.php?f=5&t=168
Page 2 of 2
Author:  D.Bane [ Tue Nov 15, 2011 4:39 am ]
Post subject:  Re: Code Snippet03--SplashWindow(Timer driven)

Hi to all.

Sam. I was looking to add some changes to the Window class of ecere and while going through code I wanted to try something.

I have updated the splash.ec file with these new codes:

Code: Select all

 
 opacity = 0.5;
 alphaBlend = true;
 bool effectGoDown; effectGoDown = true; // CHECK THIS OUT - TRUE/FALSE - different results
 
and this in timer's expired function

Code: Select all

 
 if(effectGoDown == true)
  { opacity += 0.1; } //better effects
 else
  { opacity -= 0.1; }
 
I have also attached the entire flash.ec file.

I think this adds a bit more to the splash screen. To use it as you would like you need to think about next thing. The background color is very important as depending on the color, you will get transparency of different percentages. For example, the white color is opaque even if the opacity is set to 0, but if you set the opacity to 0 and have black for your background you will barely see it.

Oh, and a suggestion for Jerome and Redj, some functions do not have a name that others can understand at the first, it might be better to have a comment line just under the start of function that will tell something like 'used for setting position of window', 'used for moving window'...

O, and ecere is cool :)

Thank you,
D.Bane.
Author:  jerome [ Tue Nov 15, 2011 11:30 am ]
Post subject:  Re: Code Snippet03--SplashWindow(Timer driven)

Hi D. Bane,

Thanks for posting this opacity tweak :)

About your suggestion for comments, the idea would be that the documentation (accessible from F1 in the IDE) would have a detailed description and usage information for the whole Ecere API. Some of it might be written already, but it is not complete at this point.

That is a high priority but unfortunately my time is very limited right now. Help is welcome :)

Regards,

Jerome
Author:  D.Bane [ Tue Nov 15, 2011 6:13 pm ]
Post subject:  Re: Code Snippet03--SplashWindow(Timer driven)

Hi Jerome.

I understand about the time very well :)

I am trying out some things, hopefully I will be able to add some things to ecere as well, I am amazed by how everything works with ecere.

For now I am looking to figure out opacity as much as possible, and add a tooltip property to the window class and some other things...

Regarding splash.ec. If anyone wants to create a fast and nice looking splash screen I would suggest going with

Code: Select all

i = 50;
and

Code: Select all

delay = 0.05;
and go up and down with opacity...

I will create a ReadyToUse Splash class, with few effects when I get time.
Author:  samsam598 [ Wed Nov 16, 2011 8:06 pm ]
Post subject:  Re: Code Snippet03--SplashWindow(Timer driven)

Hi D.Bane,

Thank you so much for all you've done!Looking forward to the complete SplashWindow class.I encountered weird crash when I tried to modify i to 50 and/or delay to 0.05.
Author:  D.Bane [ Thu Nov 17, 2011 4:24 am ]
Post subject:  Re: Code Snippet03--SplashWindow(Timer driven)

Hi.

Sam, I believe that you have not changed the char[2] to char[3] or more.. I am sorry that I have not said that as well.

OK. Here is the splash.ec with i = 50; I also added up and down transition to it..you'll see :)

So basically if that was the case with the error, you had a small bucket and tried to put to much in it...

I changed this:

Code: Select all

int i; i=50;
....
Timer timer
 {
    userData = this, started = true, delay = 0.1;

    bool DelayExpired()
    {

       char msg[3]; //this here - and it needs to be updated with regards of the number.. 0-9 char[2] 10-99 char[3] 100-999 char[4]... because of the '\0'
        ...
       if(effectGoDown == true) //better effects
       {
          opacity += 0.05;
          if (i == 25)
          {effectGoDown = false;}
       }
       ....
    }
Author:  samsam598 [ Thu Nov 17, 2011 4:53 am ]
Post subject:  Re: Code Snippet03--SplashWindow(Timer driven)

Sorry for my careless,I should have found the buffer overflow issue by myself.Thanks again!
All times are UTC-05:00 Page 2 of 2