Levelshot (Click map name in list-->Show small image)
by Chris Byars · in Torque Game Engine · 03/28/2005 (6:49 am) · 11 replies
Heh. One thing that's been troubling my GUI is, getting it so when I click on one of the map names in the create game list, to have a small 128x128 or so image appear to give you a "levelshot" of the map you wish to load, so you can see if that's the one you wish to load up.
Any suggestions? Besides saying to simply look into the code deeper. If I could've found it by that, I'd've already. =P
Thanks.
Any suggestions? Besides saying to simply look into the code deeper. If I could've found it by that, I'd've already. =P
Thanks.
#2
03/28/2005 (7:43 am)
Interesting, I'll take a look into it.
#3
03/28/2005 (8:28 am)
Could you explain technically how I would set this as you said? =)
#4
03/28/2005 (2:26 pm)
I know its been done in Realm Wars, and maybe a few other Torque based games, someone's gotta know exactly how it is structured.
#5
Ok, Here's a pretty quick solution to this...
EDIT: link removed, see below for link to the resource
Grab that, there's two files in there. Copy stronghold.mis.png into your missions folder, and copy the startMissionGui.gui script into starter.fps/client/ui (back up the old one first)
This is really quick and dirty, but maybe it'll give you some ideas. Basically, it just looks for a preview image that has the same name as the mission file (with .png on the end) and displays it. (If there isn't an image avaliable it just shows a empty rectanagle)
Note that this was meant to go with the starter.fps kit, if you don't have a stronghold.mis it won't work. You'll also need to provide your own level screenshots for each level.
Like I said, this is really ugly, but it works and it's a start.
03/29/2005 (4:05 pm)
Sorry dude, I forgot to turn on "Notify me" for this thread.Ok, Here's a pretty quick solution to this...
EDIT: link removed, see below for link to the resource
Grab that, there's two files in there. Copy stronghold.mis.png into your missions folder, and copy the startMissionGui.gui script into starter.fps/client/ui (back up the old one first)
This is really quick and dirty, but maybe it'll give you some ideas. Basically, it just looks for a preview image that has the same name as the mission file (with .png on the end) and displays it. (If there isn't an image avaliable it just shows a empty rectanagle)
Note that this was meant to go with the starter.fps kit, if you don't have a stronghold.mis it won't work. You'll also need to provide your own level screenshots for each level.
Like I said, this is really ugly, but it works and it's a start.
#7
Do you know how to add the mission description with the preview pic?
Thanks in advance.
Joseph.
04/03/2005 (9:38 am)
Hey Drew, Do you know how to add the mission description with the preview pic?
Thanks in advance.
Joseph.
#8
It hasn't been tested very well. There will be some strange behavior if a mission doesn't have a MissionInfo. (it probably won't display anything)
Anyway, check it out, I'm sure you'll be able to customize or finish this if you read through the functions at the end of the gui file. One improvement that you could make is to store the preview image's filename in the MissionInfo.
EDIT: Ok, now it's working, go ahead and grab it.
04/03/2005 (4:54 pm)
Joseph, I updated the zip file I linked above, just grab it again.It hasn't been tested very well. There will be some strange behavior if a mission doesn't have a MissionInfo. (it probably won't display anything)
Anyway, check it out, I'm sure you'll be able to customize or finish this if you read through the functions at the end of the gui file. One improvement that you could make is to store the preview image's filename in the MissionInfo.
EDIT: Ok, now it's working, go ahead and grab it.
#9
04/05/2005 (1:22 am)
Should post as a resource, pretty useful start.
#10
I'm writing the instructions right now, I'll post a link once i'm done with it.
EDIT: The zip posted above is pretty much the same thing functionality-wise, but the new version is a little more fault tolerant.
EDIT2: It's up but awaiting approval.
04/23/2005 (10:59 pm)
I was bored tonight, so I cleaned this up and made it into a nice resource. I'm writing the instructions right now, I'll post a link once i'm done with it.
EDIT: The zip posted above is pretty much the same thing functionality-wise, but the new version is a little more fault tolerant.
EDIT2: It's up but awaiting approval.
#11
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=7675
04/24/2005 (8:29 pm)
Ok, the resource is up and approved.www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=7675
Torque Owner Drew Hitchcock
You could add a preview image field to the missioninfo object and read it at the same time you read the name/description. Then, when the user chooses the map from the list, set a bitmap control to display that image. You'd have to manually take the screenshots place them in a folder, and set up the preview field, but that's probably not a very big deal.