Jump to content

StaticImageLoadImage and the children bug


launemax

Recommended Posts

Hy my friends 8)

i'm currently stuck in a very annoying bug of MTA (, isnt it?)

If I use GuiStaticImageLoadImage and change the image of this element, all other StaticImages, that are parented inside this element, also gets changed. So it propagates down to each child element. Damnit! :evil:

Is there a way to fix this? I just want to change ONE Image and the child elements should stay the same.

A quick example:

local frame, image 
addEventHandler("onClientResourceStart", resourceRoot, function() 
  
    frame = guiCreateStaticImage(0, 0, 400, 400, "frame.png", false) 
    image = guiCreateStaticImage(100, 100, 200, 200, "image.png", false, frame) 
     
    bindKey("i", "down", changeImage) 
end) 
  
function changeImage() 
    guiStaticImageLoadImage(frame, "otherframe.png") 
end 

<meta> 
    <info name="Test" author="Launemax" version="1.0" type="script" /> 
    <script src="client.lua" type="client" /> 
    <file src="frame.png" /> 
    <file src="image.png" /> 
    <file src="otherframe.png" /> 
</meta> 

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