Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Loading Custom Tiles?  (Read 1477 times)

0 Members and 1 Guest are viewing this topic.

Ryuza

That one guy
Loading Custom Tiles?
« on: December 17, 2010, 04:38:25 am »
  • RyuKage2007
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 290
[-Solved-]

So, I'm working on a small project and I was curious if anyone might be able to help me, I'm using GM8 by the way.

Anyway, I'm trying to find the best way to go about loading a custom tilesheet, I want to distribute my game with two .png files (cstile.png & csbkg.png) that could be edited and used in-game as custom tiles and backgrounds. I got the custom background working easy, just background_replace(), but I'm not sure how to load an external image file and then use it as a tilesheet.

Anyone know how I might be able to achieve this? Is it possible I could replace the image in a existing tilesheet using background_replace()? If so I'm not quite sure how to refer to a tilesheet used in a room rather then the background which is normally just background_index[0, 1, etc.].

Thanks in advance to any that may be able to help.
« Last Edit: December 27, 2010, 05:31:53 pm by Ryuza »
Logged
<- Koholint Island - MC Style  <- Link's Awakening Photo Recolors  <- Wind Waker 3D Resources <- Super Mario Bros Crossover
  • RyuKage2007's Youtube

DJvenom

super-sage
Re: Loading Custom Tiles?
« Reply #1 on: December 17, 2010, 08:05:29 am »
  • Colbydude was here.
  • *
  • Reputation: +7/-0
  • Offline Offline
  • Gender: Female
  • Posts: 2898
Well, if you replace the background using background_replace, it replaces the resource itself, not the in-room background (background_index):

Example: You have 3 external images of a sky, 1 day, 1 sunset, 1 night.
all you really need is create a blank background in your game, and use background_replace to replace the blank background with whatever bg you wanna draw :P
background_replace(0,working_directory+"/sky_1.png",0,0) would load the day sky
background_replace(0,working_directory+"/sky_2.png",0,0) would load the noon sky
and background_replace(0,working_directory+"/sky_3.png",0,0) would load the night sky

and if you use the background in question as a tileset, any and all tiles used on it would be replace with the corresponding tiles on those sets as well ( good for day/night engines ;) )

If you'd like an example, I'd be happy to program one up :)
Logged
I do art
I ermmm... DID do art
I do art

Ryuza

That one guy
Re: Loading Custom Tiles?
« Reply #2 on: December 17, 2010, 01:05:51 pm »
  • RyuKage2007
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 290
Okay, I think I've got it then. Thanks, I'll try it out when I finish up with work later.

Edit: Got it working, thanks DJ.
« Last Edit: December 27, 2010, 05:33:31 pm by Ryuza »
Logged
<- Koholint Island - MC Style  <- Link's Awakening Photo Recolors  <- Wind Waker 3D Resources <- Super Mario Bros Crossover
  • RyuKage2007's Youtube
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.068 seconds with 43 queries.

anything