[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Enigma-cvs] enigma/data models.lua,1.7,1.8
From: |
Daniel Heck <address@hidden> |
Subject: |
[Enigma-cvs] enigma/data models.lua,1.7,1.8 |
Date: |
Sun, 16 Nov 2003 18:00:50 +0000 |
Update of /cvsroot/enigma/enigma/data
In directory subversions:/tmp/cvs-serv15175/data
Modified Files:
models.lua
Log Message:
DefineTiles(): new function
Index: models.lua
===================================================================
RCS file: /cvsroot/enigma/enigma/data/models.lua,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** models.lua 18 Oct 2003 13:49:00 -0000 1.7
--- models.lua 16 Nov 2003 18:00:48 -0000 1.8
***************
*** 123,140 ****
end
-
-- Generate multiple image models by tiling a big image into many
-- smaller subimages. The parameters are currently hardcoded, see
-- "items.png" for an example image.
! function def_tiles(big_image, modelnames)
local xoff = 0
local yoff = 0
- local imgw = 640
local tilew = 32
local tileh = 32
! local r=Rect:new(0,0,0,0)
for i,mname in modelnames do
r.x,r.y,r.w,r.h = xoff,yoff,tilew,tileh
! display.DefineSubImage(mname, big_image, 0, 0, r)
xoff = xoff + tilew
if xoff >= imgw then
--- 123,142 ----
end
-- Generate multiple image models by tiling a big image into many
-- smaller subimages. The parameters are currently hardcoded, see
-- "items.png" for an example image.
! function DefineTiles(imagename, modelnames)
local xoff = 0
local yoff = 0
local tilew = 32
local tileh = 32
!
! local image = GetSurface (imagename)
! local imgw = image:width()
! local r=Rect:new(0,0,32,32)
for i,mname in modelnames do
r.x,r.y,r.w,r.h = xoff,yoff,tilew,tileh
! local subsurface = CropSurface (image, r)
! DefineImageModel (mname, subsurface)
xoff = xoff + tilew
if xoff >= imgw then
***************
*** 145,148 ****
--- 147,151 ----
r:delete()
end
+
function def_stone(name, shmodel, opt)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Enigma-cvs] enigma/data models.lua,1.7,1.8,
Daniel Heck <address@hidden> <=