Jump to content
dragontechi

help map name in center

Recommended Posts

image.png.11d57a3c587cb1e79f603ed9d0dbb369.png

 

 

how can i make the map end in the center like pirates online do this is their code

--Map Name
labMapName = UI_CreateCompent( frmMinimap, LABELEX_TYPE, "labMapName", 100, 15, 15, 3 )
UI_SetCaption( labMapName, "Map Name" )
UI_SetTextColor( labMapName, COLOR_WHITE )
UI_SetLabelExFont( labMapName, FONT12B, FALSE, 4284846015 )
UI_SetLabelExAlign(labMapName, 1)

this is my code

--Load map name display
labMapName = UI_CreateCompent( frmMinimap, LABELEX_TYPE, "labMapName", 100, 16, 25, 12 )
UI_SetCaption( labMapName, "Map Name" )
UI_SetTextColor( labMapName, COLOR_WHITE )
UI_SetLabelExFont( labMapName, FONT12B, FALSE, 4284846015 )

when entering

UI_SetLabelExAlign(labMapName, 1)

i get error

CaLua Library : Error running script scripts/lua/forms/minimap.clu : 
 scripts/lua/forms/minimap.clu:28: attempt to call global `UI_SetLabelExAlign' (a nil value)

I'm using src but it doesn't seem to execute that line that I imagine is the central one the name of the map

Share this post


Link to post
Share on other sites

Hello @dragontechi,

 

On 11/11/2022 at 6:58 PM, dragontechi said:

when entering


UI_SetLabelExAlign(labMapName, 1)

i get error


CaLua Library : Error running script scripts/lua/forms/minimap.clu : 
 scripts/lua/forms/minimap.clu:28: attempt to call global `UI_SetLabelExAlign' (a nil value)

I'm using src but it doesn't seem to execute that line that I imagine is the central one the name of the map

Looks like UI_SetLabelExAlign() is a custom function which is developed by Pirates Online team. 

 

You should develop your own function which will calculate position of the text depending on its length and window size.


Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...