UV something (filling the layout with a sprite)

For questions about using Classic.

Post » Tue Aug 30, 2011 11:19 am

The trick is:
i want to fill the layout with a the same sprite. Preety much like with tiled background. But instead of hand-placing them all i would like to know the method for this to be done X number of times in grid order.

I do remember there was a method of doing this with UV command or something and that i heard about it from Newt. Sadly i cannot find it on forums.

Can someone please aid me on this?

kudos! :)
B
16
S
5
G
4
Posts: 211
Reputation: 3,767

Post » Tue Aug 30, 2011 6:31 pm

Here is an example that makes a sprite a 11x11 gird of it's image over it's area:
http://dl.dropbox.com/u/5426011/examples6/uvtiled.cap

If you want it to cover the screen just make the sprite the size of the screen.
B
79
S
24
G
54
Posts: 4,746
Reputation: 40,755

Post » Tue Aug 30, 2011 6:54 pm

Loop the window whidth divided by the sprite width times the window height divided by the sprite height and create a copy on the chosen position, that is if your hotspot is in the top left corner and i understand you correctly-
B
18
S
4
G
1
Posts: 413
Reputation: 2,512

Post » Tue Aug 30, 2011 8:02 pm

[QUOTE=R0J0hound] Here is an example that makes a sprite a 11x11 gird of it's image over it's area:
http://dl.dropbox.com/u/5426011/examples6/uvtiled.cap

If you want it to cover the screen just make the sprite the size of the screen.[/QUOTE]

hmmm it actualy works but now i remembered that i havent said that i want each of that sprite instance to have a diffrent random animation frame :(

So UV wont help here?
B
16
S
5
G
4
Posts: 211
Reputation: 3,767

Post » Tue Aug 30, 2011 8:17 pm

Well, in that case just use two for cycles, one within the other for x and y to place your sprites. That way you can set the animations and whatever else you like.

I recently used this to place 10240 sprites in a grid formation, no problem at all (except for a certain performance drop).
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 7 guests