I Require Aid.

Posted by Charlie Carlo on Aug. 9, 2012, 10:39 p.m.

Okay, so as you may know, I created a super awesome lighting engine.

As you may not know, I have no idea how to handle tiles with code.

My current way to put a background and foreground into the room is create them both with tiles separately and save them as a huge image and put it in the game. As you can imagine, this is retarded.

The reason for this is, the view isn't actually a view. Instead of the view looking at different parts of an image, the image just draws itself at different parts depending on where the view is. Poly taught me that crazy technique, but I don't think he uses tiles.

I don't know if I can use tiles with this system, though, which sucks.

I want to just place tiles by hand in the room editor. But in order to do this I'll have to alter my drawing script to:

1. Hide all tiles (because otherwise they'll draw weirdly on top of the surface.)

2. Draw all tiles at depth 1 onto a surface, with an offset of -view_xview, -view_yview.

*My current script goes here

3. Draw all tiles at depth -1 onto the surface with the same offset.

Basically, I'm asking if anyone knows how to draw all tiles at a certain depth onto a surface like a background.

Plox, guys, I really need help here.

Comments

Charlie Carlo 12 years, 2 months ago

Quote:
Tile_add() BTW? I'd use tile_layer_find(), else you're creating more and more tiles all the time and will leak memory.
I don't know what tile_add does to be honest, but I know what it doesn't do, and that's draw a tile to the target surface.

And I was originally going to just run this script at the room creation event once, and record background tiles to sur_bg, and foreground tiles to sur_fg, but instead I managed to find a way to do it without handling tiles in code in any way.

Taizen Chisou 12 years, 2 months ago

Did I explain how for loops worked though :(

Charlie Carlo 12 years, 2 months ago

Yeah but I don't remember anything about nesting. I don't know why I don't just ask my dad about this kind of stuff, he's a professional programmer.

Juju 12 years, 2 months ago

tile_add() is not the function you want if you're trying to draw a tile to a surface.

What you want is draw_background_part().