Jump to content


Photo

Upcoming level preview image?


  • This topic is locked This topic is locked
13 replies to this topic

#1 gorinds

gorinds

    GMC Member

  • GMC Member
  • 148 posts

Posted 18 March 2012 - 01:10 PM

So couldn't find this anywhere.(Didn't search that long either) :whistle:
How could you make an image of the upcoming level. Probably with views.
But the kind of like "thumbnail" image of the next lvl would be in the previous room.
So how can you get the level image from next room where the room loads?

man... that was hard to explain, hope you get it.
  • 0

#2 jf11

jf11

    GMC Member

  • New Member
  • 9 posts
  • Version:GM:Studio

Posted 18 March 2012 - 05:41 PM

Take a print screen (or with HD screenshot program) from the room.
Edit the image as you like and resize the image to half (1/4) or what you want it to be.
and then just draw that image to preview the room .
  • 0

#3 gorinds

gorinds

    GMC Member

  • GMC Member
  • 148 posts

Posted 18 March 2012 - 06:00 PM

Yeah but if i wanted it not to be so hard coded, because if the player makes his own lvl. It should be able to show that too in the preview.
  • 0

#4 jf11

jf11

    GMC Member

  • New Member
  • 9 posts
  • Version:GM:Studio

Posted 18 March 2012 - 06:07 PM

load image in game
  • 0

#5 Gamer3D

Gamer3D

    Human* me = this;

  • GMC Member
  • 1619 posts
  • Version:GM:Studio

Posted 18 March 2012 - 06:15 PM

When a player saves his/her own level, save a preview image of it (resized down to preview size) by drawing everything to a surface, scaling it, and saving it. Do the same for the levels you make.
  • 0

#6 gorinds

gorinds

    GMC Member

  • GMC Member
  • 148 posts

Posted 18 March 2012 - 06:54 PM

Yeah could work... but will I just save the pics to a folder or any chance the player couldn't mod the pictures so easy?
Just wondering could they be saved more safe.
  • 0

#7 DanRedux

DanRedux

    GMC Member

  • GMC Member
  • 1336 posts
  • Version:GM:Studio

Posted 19 March 2012 - 01:15 AM

Yes, the players could edit that image, but it wouldn't matter.. It would just mean they don't see the next preview. Why would anyone want to edit it?
  • 0

#8 JAk HAk

JAk HAk

    sepius fidelis

  • New Member
  • 713 posts
  • Version:GM:HTML5

Posted 19 March 2012 - 02:49 AM

Change the filename to something that people aren't likely to realize is actually an image, or go and actually encrypt it.

Alternately, iterate through all of the levels at the beginning of the game. In each one, grab a screen and then paint black over the room so that the user never sees anything. Stick all of those screens into a sprite or series of sprites, and add to that each time a user creates a new level.
  • 0

#9 gorinds

gorinds

    GMC Member

  • GMC Member
  • 148 posts

Posted 19 March 2012 - 12:00 PM

Okay! ill try something... And i agree that no one would change it, but it would be nicer that it wasnt so obvious. And good practise.
:D
But THANKS for every one!
  • 0

#10 Yal

Yal

    Gun Princess

  • Global Moderators
  • 5865 posts
  • Version:GM8.1

Posted 27 March 2012 - 01:58 PM

Yeah but if i wanted it not to be so hard coded, because if the player makes his own lvl. It should be able to show that too in the preview.

If you save the level to a file, you could read the file and create tiles with 25% scaling (plus a stretched background tile) and then just delete them if the player cancels or selects another level. This is especially really good if you only show part of the level, say the first screen of it, because then you don't have to read the whole file. (It takes some extra sorting first so you can see what is inside the screen at level start, but taking extra time when saving the level is likely better than taking extra time when just generating the screenshot, you'll likely save levels less often than you'll play them!)
  • 0

#11 gorinds

gorinds

    GMC Member

  • GMC Member
  • 148 posts

Posted 27 March 2012 - 04:02 PM

@Yal

Yeah that sounds way more better. That way I wouldn't have to save the images and waste space.
But I don't know how to make that work. :confused:
Any help?

Edited by gorinds, 27 March 2012 - 04:03 PM.

  • 0

#12 Yal

Yal

    Gun Princess

  • Global Moderators
  • 5865 posts
  • Version:GM8.1

Posted 28 March 2012 - 11:01 AM

If you don't know how to read data from a text file, you shouldn't be in Advanced Users Only :whistle:
  • 0

#13 gorinds

gorinds

    GMC Member

  • GMC Member
  • 148 posts

Posted 28 March 2012 - 12:33 PM

No no, I know how to read them, but now it only creates the instances to the map.
I don't know how to make it like you said, tiles and stuff. (make it scaled and look like image)
  • 0

#14 Yal

Yal

    Gun Princess

  • Global Moderators
  • 5865 posts
  • Version:GM8.1

Posted 29 March 2012 - 12:57 PM

Hmmm... that's too bad. I made a similar system for Cave Game, and since I used tiles for collisions (and stored them so that you could open a file and see the level structure by inspecting the text) I could always stop reading once I'd read all the tiles.

You could do something like this:
- Make all objects that will appear in levels a children or grandchildren of "parent_levelobject"
- To create a level preview:

> Read the file, find the background, and place some background tiles that covers the menu
> Open the file like you'd normally do
> Shift all parent_levelobject instances so that the stage entrance is in focus (or just move the view)
> Take a surface snapshot of the screen
> Delete all parent_levelobject instances, should remove everything
> Delete the background tiles
> Stretch the surface to desired size and use that as the preview.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users