launemax Posted December 30, 2014 Share Posted December 30, 2014 Hy my friends 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! 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
Addlibs Posted December 30, 2014 Share Posted December 30, 2014 setElementCallPropagationEnabled should work (see example) Link to comment
launemax Posted December 30, 2014 Author Share Posted December 30, 2014 yeah! works perfect. ^^ I dont know, why i didn't find this function. Thanks, MrTasty! Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now