Welcome to the Achaea Forums! Please be sure to read the Forum Rules.

More Halp Plz

DeladanDeladan Member Posts: 647 ✭✭✭✭ - Eminent
Trying to add a background image to this. Everything I've tried has resulted in either the background image showing or the text I want to display showing but not both....

function GetRoomExits()
        roomexits = nil
        for i,v in pairs(gmcp.Room.Info.exits) do
                if not roomexits then
                        roomexits = string.upper(i)
                else
                        roomexits = roomexits..","..string.upper(i)
                end
        end
        roomexits = roomexits or "TRAPPED!"
 
roomlabel : setFgColor("white")
 
roomlabel:echo("<b>Exits<br>" ..roomexits, nil, "c")
roomlabel:setBackgroundImage("C:/MudletGFX/exitButton.png")
end
 
 roomlabel = Geyser.Label:new({name="Room Exits",x="0.5%", y="94%",width="25.5%", height=35,fontSize = 10,})
 roomlabel : setFgColor("white")
-- roomlabel:setStyleSheet([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #CC9900 stop: 1 #454545);
--    border-top: 1px black solid;
--    border-left: 1px black solid;
--    border-bottom: 1px black solid;
--    border-radius: 7;
--    padding: 3px;
--  ]])
 
registerAnonymousEventHandler("gmcp.Room.Info", "GetRoomExits")



Comments

  • LideronLideron Member Posts: 27 ✭✭✭ - Distinguished
    I've done a few things like that, so it is possible.   In mine, I use the "border-image" attribue in the StyleSheet for the label where I want the image to be displayed.   I then create a second label (with the same parent as the first) and then echo to that label, not the one where I set the background.  


  • DeladanDeladan Member Posts: 647 ✭✭✭✭ - Eminent

    function GetRoomExits()

    roomexits = nil

    for i,v in pairs(gmcp.Room.Info.exits) do

    if not roomexits then

    roomexits = string.upper(i)

    else

    roomexits = roomexits..","..string.upper(i)

    end

    end

    roomexits = roomexits or "TRAPPED!"


    roomlabel : setFgColor("white")


    roomlabel:echo("<b>Exits<br>" ..roomexits, nil, "c")

    end


    roomlabel = Geyser.Label:new({name="Room Exits",x="0.5%", y="94%",width="25.5%", height=35,fontSize = 10,})

    roomlabel : setFgColor("white")

    roomlabel:setStyleSheet[[

    border-image: url(C:/MudletGFX/exitButton.png);

    ]]


    registerAnonymousEventHandler("gmcp.Room.Info", "GetRoomExits")



    That works. Thanks


Sign In to Comment.