Post by xebeth on Dec 25, 2005 19:27:25 GMT -5
First script, first post...
Here goes:
along with that impressive skin.ini:
(the lack of space after the second value is on purpose)
It gives this for me:
I wanted to get images instead of blue/white boxes...
My problem is the SetTexture thing not working for me.
I tried loading the goblins sample, nothing shows (probably because the image is a 305x295 png when the documentation says jpg or bmp with dimensions multiple of 8). The lunar splashscreen is not showing properly either (maybe its a problem on the laptop I'm working with).
Anyway, any pointer on the way to get a texture to display would be nice...
Here goes:
function ui_createWindow(filename, posx, posy, alpha)
if (filename == nil) then
return false;
end
file = io.open (filename);
w = 0;
h = 0;
ww = 0;
hh = posy;
if (file) then
for j=0,2,1 do
ww = posx;
for i=0,2,1 do
w = file:read("*n");
h = file:read("*n");
gfx = file:read();
index = i+j*3;
objects[index] = Graphics.primitive_CreateObject();
Graphics.primitive_SetVisibility(0,objects[index]);
Graphics.primitive_SetColor(alpha,255,255,255,objects[index]);
Graphics.primitive_SetTexture(gfx,objects[index]);
Graphics.primitive_SetPosition(ww, hh, objects[index]);
Graphics.primitive_SetSize(w,h,objects[index]);
Graphics.primitive_SetFitToTexture(true, objects[index]);
ww = ww + w;
end
hh = hh + h;
end
else
return false;
end
Graphics.primitive_SetColor(alpha,35,34,84,objects[4]);
for i=0,8,1 do
Graphics.primitive_SetVisibility(1,objects[i]);
end
return true;
end
objects = {};
ui_createWindow ("f:\\skin.ini", 250, 250, 100);
while true do
Windower.script_Sleep(1000);
end
along with that impressive skin.ini:
3 3stopl.bmp
400 3top.bmp
3 3topr.bmp
3 300left.bmp
400 300body.bmp
3 300right.bmp
3 3botl.bmp
400 3bottom.bmp
3 3botr.bmp
(the lack of space after the second value is on purpose)
It gives this for me:
I wanted to get images instead of blue/white boxes...
My problem is the SetTexture thing not working for me.
I tried loading the goblins sample, nothing shows (probably because the image is a 305x295 png when the documentation says jpg or bmp with dimensions multiple of 8). The lunar splashscreen is not showing properly either (maybe its a problem on the laptop I'm working with).
Anyway, any pointer on the way to get a texture to display would be nice...