Jump to content

[Solved]Images problem.


Extremo

Recommended Posts

Alright so i was reading over the wiki and i am new to lua and mta in general. I decided i am going to make a basic gui window and create two tabs at the right side, register and login and thought i would place a image on the left side, its a full screen window. So i got alittle problem. I saw a function to create a static image, but obvisiously if the player is logged in, the gui Window is supposed to be removed and i dont want half of the screen to be filled by this image so basically, i need help about how to remove the image once its created or if there is any other way of creatign that image there?

This might help:

http://img406.imageshack.us/img406/6827 ... en0023.png

so the left side which is empty = image.

Edited by Guest
Link to comment

So, thanks Talidan for your fast reply, theres no real code about this issue yet, i want to make sure that there is a way before i am going to do so. So regarding to your answer i am guessing you can set anything visibile and invisible with it. Thank you for your quick reply, I am going to test this right away :D

Link to comment

Sorry for double post but i am guessing you cant change the visibility or either destroy a Image created over the function "guiCreateStaticImage"? is there any other way of creating a image?

  
local RegisOrLoginImage = guiCreateStaticImage(0, 0.03, 0.5, 1, "LogReg.png", true) 
destroyElement(RegisOrLoginImage) 
  

No real success, also:

  
local RegisOrLoginImage = guiCreateStaticImage(0, 0.03, 0.5, 1, "LogReg.png", true) 
guiSetVisible(RegisOrLoginImage, false) 
  

Nothing. The image still appears. Hope theres a other way of creating a image. Also, it could just be a function to create a image on a "guiCreateWindow". Help is appreciated :D

Link to comment

Why don't you try to debug your code or use events for this. I'd recommend you use onClientResourceStart to create that image due to some issues with GUI elements created not in event (eg. simple 2 lines like yours)... They don't always/usually function when are created like you did.

Link to comment

Thanks for your offer 50p but i find the real gui easier on use tbh. Dunno why, guess its just because i've been scripting so much and its just all logic to me. I actually think yours is even more complicated lol. Anyway, guess this case is solved, i ama edit the topic name.

Link to comment

My bad, basically their was no real solution, i had a script error right above "guiSetVisible" and had to fix it, also i tested if it works without calling a event and it doesnt. I would, as 50p said already, highly recommend you guys to use "onClientResourceStart". That was basically the solution.

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