MadMan Posted March 8, 2014 Share Posted March 8, 2014 (edited) Hello My problem is that the notification image is behind the login background for some reason (if login backround is destroyed) but if login background is visible then it looks like this here's the code addEvent("addNotification",true) addEventHandler("addNotification",getRootElement(), function(text, typ) text = string.gsub(text,"#%x%x%x%x%x%x","") local num = 0 if text == "" or text == nil or not typ then return else for i = 0, #message+1 do if message[num] then num = num+1 else message[num] = {} message[num].text = text message[num].val = true if typ == 1 then message[num].filepath = "success.png" elseif typ == 2 then message[num].filepath = "error.png" elseif typ == 3 then message[num].filepath = "info.png" elseif typ == 4 then message[num].filepath = "warning.png" end setTimer(notifyremove,5000,1,num) end end end end) -- -- -- function renderNotifications() for id, v in pairs(message) do if v.val == true then dxDrawImageSection(x-dxGetTextWidth(v.text, 1, "default-bold")-50, 35*id, dxGetTextWidth(v.text, 1, "default-bold")+50, 32, 0, 0, dxGetTextWidth(v.text, 1, "default-bold")+50, 32, v.filepath) dxDrawText(v.text,x-dxGetTextWidth(v.text,1,"default-bold")-5, 9+35*id, dxGetTextWidth(v.text, 1, "default-bold"), 32, tocolor(255,255,255,255), 1, "default-bold", "left", "top", false, false ,true, true) end end end Edited March 8, 2014 by Guest Link to comment
Karuzo Posted March 8, 2014 Share Posted March 8, 2014 You need to have layers(like in Photoshop for example) -First the Loginbackground -Second the Notification-Image. Link to comment
MadMan Posted March 8, 2014 Author Share Posted March 8, 2014 You need to have layers(like in Photoshop for example)-First the Loginbackground -Second the Notification-Image. No, i have them, the only problem is that notification layer(green) is created behind the login background(blue), Only text is visible if login background is visible, but if login background is destroyed then both notification layer and text are visible Link to comment
MadMan Posted March 8, 2014 Author Share Posted March 8, 2014 Use guiBringToFront ( ) I can't use gui functions on dx functions Link to comment
Blaawee Posted March 8, 2014 Share Posted March 8, 2014 I would to complete the arguments. you have to complete dxDrawImageSection arguments and make sure the "postgui" true. Link to comment
MadMan Posted March 8, 2014 Author Share Posted March 8, 2014 I would to complete the arguments. you have to complete dxDrawImageSection arguments and make sure the "postgui" true. postgui is true Link to comment
Blaawee Posted March 8, 2014 Share Posted March 8, 2014 HelloMy problem is that the notification image is behind the login background for some reason (if login backround is destroyed) but if login background is visible then it looks like this here's the code addEvent("addNotification",true) addEventHandler("addNotification",getRootElement(), function(text, typ) text = string.gsub(text,"#%x%x%x%x%x%x","") local num = 0 if text == "" or text == nil or not typ then return else for i = 0, #message+1 do if message[num] then num = num+1 else message[num] = {} message[num].text = text message[num].val = true if typ == 1 then message[num].filepath = "success.png" elseif typ == 2 then message[num].filepath = "error.png" elseif typ == 3 then message[num].filepath = "info.png" elseif typ == 4 then message[num].filepath = "warning.png" end setTimer(notifyremove,5000,1,num) end end end end) -- -- -- function renderNotifications() for id, v in pairs(message) do if v.val == true then dxDrawImageSection(x-dxGetTextWidth(v.text, 1, "default-bold")-50, 35*id, dxGetTextWidth(v.text, 1, "default-bold")+50, 32, 0, 0, dxGetTextWidth(v.text, 1, "default-bold")+50, 32, v.filepath) dxDrawText(v.text,x-dxGetTextWidth(v.text,1,"default-bold")-5, 9+35*id, dxGetTextWidth(v.text, 1, "default-bold"), 32, tocolor(255,255,255,255), 1, "default-bold", "left", "top", false, false ,true, true) end end end will it's not. addEvent("addNotification",true) addEventHandler("addNotification",getRootElement(), function(text, typ) text = string.gsub(text,"#%x%x%x%x%x%x","") local num = 0 if text == "" or text == nil or not typ then return else for i = 0, #message+1 do if message[num] then num = num+1 else message[num] = {} message[num].text = text message[num].val = true if typ == 1 then message[num].filepath = "success.png" elseif typ == 2 then message[num].filepath = "error.png" elseif typ == 3 then message[num].filepath = "info.png" elseif typ == 4 then message[num].filepath = "warning.png" end setTimer(notifyremove,5000,1,num) end end end end) -- -- -- function renderNotifications() for id, v in pairs(message) do if v.val == true then dxDrawImageSection(x-dxGetTextWidth(v.text, 1, "default-bold")-50, 35*id, dxGetTextWidth(v.text, 1, "default-bold")+50, 32, 0, 0, dxGetTextWidth(v.text, 1, "default-bold")+50, 32, v.filepath, 0, 0, 0, tocolor(255,255,255,255), true ) dxDrawText(v.text,x-dxGetTextWidth(v.text,1,"default-bold")-5, 9+35*id, dxGetTextWidth(v.text, 1, "default-bold"), 32, tocolor(255,255,255,255), 1, "default-bold", "left", "top", false, false ,true, true) end end end 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