Jump to content

Problem with Image


MadMan

Recommended Posts

Hello

My problem is that the notification image is behind the login background for some reason :/

(if login backround is destroyed)

mta-screen_2014-03-08_13-10-31.png

but if login background is visible then it looks like this :/

mta-screen_2014-03-08_13-10-32.png

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 by Guest
Link to comment
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
Hello

My problem is that the notification image is behind the login background for some reason :/

(if login backround is destroyed)

mta-screen_2014-03-08_13-10-31.png

but if login background is visible then it looks like this :/

mta-screen_2014-03-08_13-10-32.png

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

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