Jump to content

help center image


iPrestege

Recommended Posts

hello how can i set the image in the center for all players screen ?? i find centerWindow but i think it,s for guiwindow only ~

:wink:

  
function centerWindow(center_window) 
    local screenW,screenH=guiGetScreenSize() 
    local windowW,windowH=guiGetSize(center_window,false) 
    local x,y = (screenW-windowW)/2,(screenH-windowH)/2 
    guiSetPosition(center_window,x,y,false) 
end 
IMg = guiCreateStaticImage(30, 28, 355, 251, "img.png", false) -- you image 
centerWindow( IMg ) 
  

Edited by Guest
Link to comment

hello how can i set the image in the center for all players screen ?? i find centerWindow but i think it,s for guiwindow only ~

:wink:

  
function centerWindow(center_window) 
    local screenW,screenH=guiGetScreenSize() 
    local windowW,windowH=guiGetSize(center_window,false) 
    local x,y = (screenW-windowW)/2,(screenH-windowH)/2 
    guiSetPosition(center_window,x,y,false) 
end 
IMg = guiCreateStaticImage(30, 28, 355, 251, "img.png", false) -- you image 
centerWindow( IMg ) 
  

centerWindow i mean image not window !

Link to comment

hello how can i set the image in the center for all players screen ?? i find centerWindow but i think it,s for guiwindow only ~

:wink:

  
function centerWindow(center_window) 
    local screenW,screenH=guiGetScreenSize() 
    local windowW,windowH=guiGetSize(center_window,false) 
    local x,y = (screenW-windowW)/2,(screenH-windowH)/2 
    guiSetPosition(center_window,x,y,false) 
end 
IMg = guiCreateStaticImage(30, 28, 355, 251, "img.png", false) -- you image 
centerWindow( IMg ) 
  

centerWindow i mean image not window !

did you try it ? :wink:

this code work with anything =\

Link to comment
Yeah and the script not working now :shock:

show me your script

function centerWindow(center_window) 
    local screenW,screenH=guiGetScreenSize() 
    local windowW,windowH=guiGetSize(center_window,false) 
    local x,y = (screenW-windowW)/2,(screenH-windowH)/2 
    guiSetPosition(center_window,x,y,false) 
end 
  
  
    Image = guiCreateStaticImage( 0, 0, 1920, 1200, "login.jpeg", false ) 
    centerWindow( Image ) 

Link to comment
  
function centerWindow(center_window) 
    local screenW,screenH=guiGetScreenSize() 
    local windowW,windowH=guiGetSize(center_window,false) 
    local x,y = (screenW-windowW)/2,(screenH-windowH)/2 
    guiSetPosition(center_window,x,y,false) 
end 
  
  
    Image = guiCreateStaticImage( 0, 0, 1920, 1200, "TD[M]ER.png", false ) 
 guiSetVisible ( Image ,true ) 
    centerWindow( Image ) 
  

now it's work =D

meta.xml

    "Imge" version="1.0" type="script" name="img"/> 
     
    

Link to comment
  
function centerWindow(center_window) 
    local screenW,screenH=guiGetScreenSize() 
    local windowW,windowH=guiGetSize(center_window,false) 
    local x,y = (screenW-windowW)/2,(screenH-windowH)/2 
    guiSetPosition(center_window,x,y,false) 
end 
  
  
    Image = guiCreateStaticImage( 0, 0, 1920, 1200, "TD[M]ER.png", false ) 
 guiSetVisible ( Image ,true ) 
    centerWindow( Image ) 
  

now it's work =D

meta.xml

    "Imge" version="1.0" type="script" name="img"/> 
     
    

does not work: (

Link to comment

-- Client Side :

|ِ-- Do not remove the green text! 
-- ><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>< 
  
-- Script by: John_Scott 
-- Skype: dekaman12 
-- Release date: 2013.01.06 
-- Made in Hungary 
-- Original langue: Hungaryan 
  
-- >>>>> Hard Bytes Team <<<<< 
-- facebook.com/HardBytesTeam 
-- IP: 91.82.85.203:22076 
-- >>>>> Hard Bytes Team <<<<< 
  
-- ><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>< 
-- Do not remove the green text! 
  
  
  
wdwLogin_Pannel = {} 
tabPannel_Main = {} 
tab_Login = {} 
tab_Register = {} 
  
function open_log_reg_pannel() 
if not(isElement(wdwLogin_Pannel)) then 
  
    showChat(false) 
  
    x,y = guiGetScreenSize() 
  
function centerWindow(center_window) 
    local screenW,screenH=guiGetScreenSize() 
    local windowW,windowH=guiGetSize(center_window,false) 
    local x,y = (screenW-windowW)/2,(screenH-windowH)/2 
    guiSetPosition(center_window,x,y,false) 
end 
  
  
    Image = guiCreateStaticImage( 0, 0, 1920, 1200, "login_bg.jpeg", false ) 
    guiSetEnabled (Image, false) 
  
    Login_img = guiCreateStaticImage( X, Y + 120, 350, 350, "login_window.png", false ) 
    centerWindow( Login_img ) 
    guiSetEnabled (Login_img, false) 

Link to comment
  
  
    x,y = guiGetScreenSize() 
  
function centerWindow(center_window) 
    local screenW,screenH=guiGetScreenSize() 
    local windowW,windowH=guiGetSize(center_window,false) 
    local x,y = (screenW-windowW)/2,(screenH-windowH)/2 
    guiSetPosition(center_window,x,y,false) 
end 
  
  
    Image = guiCreateStaticImage( 0, 0, 1, 1, "login_bg.jpeg", true ) 
    guiSetEnabled (Image, false) 
  
    Login_img = guiCreateStaticImage( X, Y + 120, 350, 350, "login_window.png", false ) 
    centerWindow( Login_img ) 
    guiSetEnabled (Login_img, false) 
  
  

Edited by Guest
Link to comment
  
  
    x,y = guiGetScreenSize() 
  
function centerWindow(center_window) 
    local screenW,screenH=guiGetScreenSize() 
    local windowW,windowH=guiGetSize(center_window,false) 
    local x,y = (screenW-windowW)/2,(screenH-windowH)/2 
    guiSetPosition(center_window,x,y,false) 
end 
  
  
    Image = guiCreateStaticImage( 0, 0, 1, 1, "login_bg.jpeg", true ) 
    guiSetEnabled (Image, false) 
  
    Login_img = guiCreateStaticImage( X, Y + 120, 350, 350, "login_window.png", false ) 
    centerWindow( Login_img ) 
    guiSetEnabled (Login_img, false) 
  
  

still not working ! :!:

Link to comment

try with this

  
     
local screenWidth, screenHeight = guiGetScreenSize() 
mainWidth,mainHeight = 350, 350 
  
    Image = guiCreateStaticImage( 0, 0, 1, 1, "login_bg.jpeg", true ) 
    guiSetEnabled (Image, false) 
  
    Login_img = guiCreateStaticImage( screenWidth/2-mainWidth/2,screenHeight/2-mainHeight/2,mainWidth,mainHeight, "login_window.png", false ) 
    guiSetEnabled (Login_img, false) 
  
  

Link to comment
try with this
  
     
local screenWidth, screenHeight = guiGetScreenSize() 
mainWidth,mainHeight = 350, 350 
  
    Image = guiCreateStaticImage( 0, 0, 1, 1, "login_bg.jpeg", true ) 
    guiSetEnabled (Image, false) 
  
    Login_img = guiCreateStaticImage( screenWidth/2-mainWidth/2,screenHeight/2-mainHeight/2,mainWidth,mainHeight, "login_window.png", false ) 
    guiSetEnabled (Login_img, false) 
  
  

thanks it works as what i mean :mrgreen: .

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...