1
Themes / Re: [Help] Image format based on emulator
« on: October 31, 2015, 07:32:01 PM »
Thanks
i have two more questions:
1. how do i save the width/height of a picture in a variable to center the image on x/y Solved
1b. now i stuck on how to convert a magic token into a integer Solved
2. how do i compare a string? [if ( string == "text")?] Solved
ps, progress update:

i have two more questions:
Code: [Select]
function screens_width()
{
local sw = screens.texture_width;
return sw;
}
fe.add_text( "[!screens_width]", 0, 0 );
Code: [Select]
fe.layout.width=1920;
fe.layout.height=1080;
local lw = fe.layout.width;
local lh = fe.layout.height;
local img = fe.add_artwork( "img.png" );
img.preserve_aspect_ratio = true;
function img_width() return img.texture_width;
function img_height() return img.texture_height;
fe.add_transition_callback( "center_image" );
function center_image( ttype, var, ttime ) {
switch ( ttype ) {
case Transition.ToNewList:
case Transition.ToNewSelection:
img.x = (lw/2)-(img_width()/2);
img.y = (lh/2)-(img_height()/2);
break;
}
return false;
}
ps, progress update:
