LoTROInterface (https://www.lotrointerface.com/forums/index.php)
-   Lua Programming Help (L) (https://www.lotrointerface.com/forums/forumdisplay.php?f=50)
-   -   Load image (https://www.lotrointerface.com/forums/showthread.php?t=1604)

Zero 08-30-2011 04:49 AM

Load image
Hey guys

Ive got a problem.
I want to load and show an image on the screen
I cant use Image.load("") and i dont want to create a button
Only a image. Can someone help me?

Garan 08-30-2011 01:41 PM

The image has to be either a .jpg or .tga file and must be in a folder under the Plugins folder (we can only reference paths relative to the Plugins folder). To display the image, you have a number of choices - you can display it as the background of a Window control, or any of the child controls of a Window control. You assign the image to be displayed by passing the relative path to the :SetBackground() method of the window or control. If it's a child control, depending on how you want it to interact with the other controls and it's parent you may also have to use then :SetBlendMode() method of the control. I would suggest researching the Turbine LUA API or downloading a couple of plugins and seeing how other authors have displayed images. The Turbine samples have some good basic examples of displaying images. Links to the Turbine API documentation and samples are here:

Zero 09-01-2011 06:10 AM

thx its work

but is there any posibility to change priority?
because my image covers the tollbar...
i hope u understand me xD

Garan 09-02-2011 11:01 PM

We only have partial control of the ZOrder (the order of the layering of Windows/Controls that are displayed). You can use the :SetZOrder() method to set an order relative to other Lua windows with higher values displaying in front of lower values. However, we have somewhat limited control with how our windows order in relation to the built-in UI elements.
SetZOrder(-1) will force a Lua window to stay always behind the Turbine UI elements (similar to HWND_BOTTOM in the Windows SetWindowPos API function except the window will stay at the bottom of the ZOrder regardless of focus and you can assign lower values which are valid relative to other Lua windows).
SetZOrder(0) will display the Lua window initially in front of most UI elements but it will be subject to falling behind any UI element that gets focus - for instance, you display your window and then open the inventory, the bags will display over your window until the user clicks on your window to bring it to front. The built-in toolbar doesn't seem to behave like a standard UI element since it seems to stay behind Lua windows when SetZOrder(0) is used.
SetZOrder(1) or any higher value will force the Lua window to stay in front of all Turbine UI elements regardless of focus (similar to HWND_TOPMOST in SetWindowPos terminology except you can assign higher values which are valid relative to other Lua windows).

Basically, windows with the same ZOrder will layer based on focus within their assigned layer of ZOrder and most of the built-in UI elements are treated as ZOrder=0. So windows with ZOrder=-2 will always be behind all elements with a higher ZOrder, but within those windows, the one that gets focus will be in front of the others of the same ZOrder. Similarly windows with ZOrder=5 will be in front of all windows with ZOrder<5 but behind all windows with ZOrder>5.

Note, using SetZOrder on a control will order the control relative to other controls on the same window, but the window's ZOrder determines whether the entire window (and it's controls) is in front of or behind another window.

Also, using SetStretchMode() will allow a control to draw outside the bounds of it's parent (think Owner in Windows terms), sometimes overlaying elements that it should not - this appears to be a bug but since SetStretchMode() is an undocumented method, there has been no response from Turbine whether this is indeed a bug.

All times are GMT -5. The time now is 05:04 PM.

vBulletin® - Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.