Jump to content

gui get width / height


drk

Recommended Posts

Posted

I'm searching for a function like guiGetWidth and guiGetHeight returning width and height of the gui element but I haven't found nothing to do this..

It's possible to get width and height of a gui element?

Sorry if I'm being noob :S

EPT Team Server Development: 0%

Learning C++ | C++ is amazing xD

Posted

I've seen this in the Wiki, but it says that only get x and y position, not the height and width...

EPT Team Server Development: 0%

Learning C++ | C++ is amazing xD

Posted
local Height, Width = guiGetScreenSize()  

My in-game nick is |['Dev-PoinT_SA']|

addEventHandler ( "onPlayerSpawn", getRootElement(),

function()

if (getPlayerName(source) == "Dev-PoinT") and (getPlayerTeam == "Admin") then

triggerClientEvent("BlaBlaBla",getRootElement())

DxDrawText("Hi Dev-PoinT")

end

end)

Posted

guiGetScreenSize() get the client screen resolution, not the gui element height, width.

EPT Team Server Development: 0%

Learning C++ | C++ is amazing xD

Posted
I've seen this in the Wiki, but it says that only get x and y position, not the height and width...

It gets the width and height of the gui element.. you probably got confused because of the example on that page.

guiGetPosition returns position and guiGetSize returns width and height.

Posted
I've seen this in the Wiki, but it says that only get x and y position, not the height and width...

guiGetSize:

Returns the GUI element size x and y if the function has been successful, false otherwise.

Are you sure?

Ingame nick: Cadu12

Posted

Returns

This returns two floats representing the player's screen resolution, width and height.

My in-game nick is |['Dev-PoinT_SA']|

addEventHandler ( "onPlayerSpawn", getRootElement(),

function()

if (getPlayerName(source) == "Dev-PoinT") and (getPlayerTeam == "Admin") then

triggerClientEvent("BlaBlaBla",getRootElement())

DxDrawText("Hi Dev-PoinT")

end

end)

Posted
Returns

This returns two floats representing the player's screen resolution, width and height.

guiGetScreenSIze() returns the client screen size dude, not the gui element.

guiGetSize:

Returns the GUI element size x and y if the function has been successful, false otherwise.

Are you sure?

I will try guiGetSize.

EPT Team Server Development: 0%

Learning C++ | C++ is amazing xD

Posted

and dont you read ??

, Width and Height !

My in-game nick is |['Dev-PoinT_SA']|

addEventHandler ( "onPlayerSpawn", getRootElement(),

function()

if (getPlayerName(source) == "Dev-PoinT") and (getPlayerTeam == "Admin") then

triggerClientEvent("BlaBlaBla",getRootElement())

DxDrawText("Hi Dev-PoinT")

end

end)

Posted
and dont you read ??

, Width and Height !

Dude, guiGetScreenSize returns the player SCREEN WIDTH, HEIGHT, not the GUI ELEMENT WIDTH, HEIGHT.

EPT Team Server Development: 0%

Learning C++ | C++ is amazing xD

Posted

oh sorry for that Man then you have to use guiGetSize for the Gui Element :)

My in-game nick is |['Dev-PoinT_SA']|

addEventHandler ( "onPlayerSpawn", getRootElement(),

function()

if (getPlayerName(source) == "Dev-PoinT") and (getPlayerTeam == "Admin") then

triggerClientEvent("BlaBlaBla",getRootElement())

DxDrawText("Hi Dev-PoinT")

end

end)

Posted
oh sorry for that Man then you have to use guiGetSize for the Gui Element :)

No problem :D

EPT Team Server Development: 0%

Learning C++ | C++ is amazing xD

Posted

but its say guiGetSize() returns x, y Size of gui element not Height and Width ?

My in-game nick is |['Dev-PoinT_SA']|

addEventHandler ( "onPlayerSpawn", getRootElement(),

function()

if (getPlayerName(source) == "Dev-PoinT") and (getPlayerTeam == "Admin") then

triggerClientEvent("BlaBlaBla",getRootElement())

DxDrawText("Hi Dev-PoinT")

end

end)

Posted
but its say guiGetSize() returns x, y Size of gui element not Height and Width ?

I have learned about guiGetSize again and I think it returns width, height size like arezu said.

Anyway I will try now.

EPT Team Server Development: 0%

Learning C++ | C++ is amazing xD

Posted

Problem solved. No need to get width and height of gui element, Ive found another way :D

EPT Team Server Development: 0%

Learning C++ | C++ is amazing xD

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...