cools
Joined: 04 Mar 2006 Posts: 46
|
Posted: Sun Mar 18, 2007 2:47 am Post subject: |
|
|
There is a way to do it. I think someone posted this function, I just modified it a bit.
| Code: | function scaleImage(newX, newY, theImage)
newImage = Image.createEmpty(newX, newY)
for x = 0, newX do
for y = 0, newY do
newImage:blit(x,y , theImage, math.floor(x*(theImage:width()/newX)),math.floor(y*(theImage:height()/newY)), 1, 1)
end
end
return newImage
end
image = Image.load("blah")
scaledimage = scaleImage(newx,newy,image)
|
If you wanted to use the Gu/Gum functions to scale the image you would need to add sceGumScale() to lua player.
| Code: | static int lua_sceGumScale(lua_State *L) {
int argc = lua_gettop(L);
if (argc != 3) return luaL_error(L, "wrong number of arguments");
ScePspFVector3 v;
v.x = luaL_checknumber(L, 1);
v.y = luaL_checknumber(L, 2);
v.z = luaL_checknumber(L, 3);
sceGumScale(&v);
return 0;
}
and {"scale", lua_sceGumScale}, in the correct spot |
and then to scale the image, lets say 2x, in lua after your regular 3d stuff:
It will resize the x and y by 2 and keep the z the same.
You can expect to see the function in lua player mod 4. |
|