Page 1 of 1

Kinda advanced question... Makslane help :D

PostPosted: Sat Oct 24, 2009 1:40 pm
by Hblade
Everyone. You've heard of my CTW, (Custom window creation) system, now I think it's time I enhance it... I need to know how to "cut" so to say numbers so that it would match the closest thing possible. Heres what I mean...

The tiles are 32 x 32, so you can have a width of 480 using the tiles because 480 can be divided into 32... but if you went... say 481, or anything different, how would you make it round to the nearest division by 32?

In other words, I need a script that would actually take a round to the nearest division of 32.. So if you have a width of 484, it would be rounded to 480, because 484 dosnt divide into 32. And if you have 637, it'll automaticlly divide into 640, because it's the closest division by 32...

Hehe, I can really enhance the CTW System this way... For example you wouldnt need canvas actors anymore... You can make windows specially from the view! :D Like this:
Code: Select all
NewWindow(388, 200, x, y, style);

Where style is the windows style that you can customly apply and name in the global code. I'll also have these features available if I can get some help with this :D
Code: Select all
ResizeWindow(width, height, x, y);
ChangeWindow(style);

Where resizing the window will resize the window! :D (It's going to be hard and I might need y9our guys' help with that too.).
And of course, ChangeWindow will change the style of the window O.o (Which... I'm going to need help on again >.>) Anyone who wants to help will be thanked :D And credits too :D

Oh, and if you want to make a text actor stick to the box, it's easy! :D Just have the text actor's X and Y to be equal to the top right corner of the window. Or we could do this.
Simply make an off screen text actor that dosnt start up at game... Then in the code
Code: Select all
NewWindow(width, height, x, y, style, textactor);

Where text actor would create a text actor if it was 1(true), and it will do nothing if it was 0(false).

Thanks in advanced :D

Re: Kinda advanced question... Makslane help :D

PostPosted: Sat Oct 24, 2009 2:06 pm
by makslane
Humm, you can't resize a game window

Re: Kinda advanced question... Makslane help :D

PostPosted: Sat Oct 24, 2009 2:07 pm
by Hblade
Thats not what I mean, the windows your resizing are created via-actors, and multiple tiles using the script :O

Re: Kinda advanced question... Makslane help :D

PostPosted: Sat Oct 24, 2009 5:21 pm
by skydereign
Well, the rounding part can be done by this.
Code: Select all
round(variable/32)*32;