image atlas

image atlas

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

image atlas

Post by smoth »

How do we do an image atlas in lua? I have never used one before so I honestly have no idea where to start understanding it.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: image atlas

Post by knorke »

What is an image atlas?
If you mean "drawing parts of a texture onto different stuff" then maybe look at zwszg's hexfarm map and scroll down to
--- How the faces are UV-mapped:
There is a nice ascii drawing but its still confusing.

SDL, but bitmap fonts are kind of good to learn the "atlas thing":
http://lazyfoo.net/SDL_tutorials/lesson30/index.php

Do you have the OpenGL® SuperBible: Comprehensive Tutorial and Reference (4th Edition)? It surely has something on that. amazon says chapter 8&9 (texture mapping) from OpenGL® SuperBible: Comprehensive Tutorial and Reference (4th Edition) seem related.

http://nehe.gamedev.net/tutorial/texture_mapping/12038/
User avatar
danil_kalina
Posts: 505
Joined: 08 Feb 2010, 22:21

Re: image atlas

Post by danil_kalina »

Spring multilingual - High five!
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: image atlas

Post by smoth »

danil_kalina wrote:Spring multilingual - High five!
Pft, not even. I just wanted to look at image atlases and see how they work.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: image atlas

Post by smoth »

knorke wrote:What is an image atlas?
If you mean "drawing parts of a texture onto different stuff" then maybe look at zwszg's hexfarm map and scroll down to
--- How the faces are UV-mapped:
There is a nice ascii drawing but its still confusing.
I want to do an image atlas for common ui elements like damage classes and other things. I remember there were some old widgets that did it but at the time I was not ready for it and several hard drives later I don't have them.

I want to say adv player list or iceui did.

Bear in mind knorke, I am seldom home right now so any of my source files or books are not readily available for me to use as reference.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: image atlas

Post by knorke »

zomgnoway i got tricked into writing something while you did not even open the OpenGL® SuperBible!
May I suggest getting an iPhone 4s, you can scream things into it and it answers.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: image atlas

Post by smoth »

knorke wrote:zomgnoway i got tricked into writing something while you did not even open the OpenGL® SuperBible!
Super bible is in bathroom across a lake, 1hour+ away.
knorke wrote:May I suggest getting an iPhone 4s, you can scream things into it and it answers.
Why do you get the impression that I am screaming at you? There were no caps.
User avatar
KaiserJ
Community Representative
Posts: 3113
Joined: 08 Sep 2008, 22:59

Re: image atlas

Post by KaiserJ »

from my experience making things like 2d games, you're doing stuff like pulling an image from the atlas using a pre-determined co-ordinate... so you've got your *atlas image and then an array holding the co-ords of each image you want to pull out (like... for sprite x, you would have corresponding co-ordinates xy to xy that determines the dimension and location of the image on the atlas)

this is the way chilli applies skins to the GUI, i'm sure you can pervert it to fit your needs for other UI elements! i mucked with it a bit making a skin for ZK; it's pretty straightforward

*edit for clarity as coffee slowly awakens me
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: image atlas

Post by smoth »

good point kais, I forgot that chili uses images as an atlas!
Post Reply

Return to “Lua Scripts”