The Image disappears when talking to an npc

Post here for help and support regarding LunaLua and SMBX2's libraries and features.

Moderator: Userbase Moderators

Marioman2007
2025 Egg Hunter
2025 Egg Hunter
Posts: 530
Joined: Tue Aug 25, 2020 3:19 am
Flair: Dr. Bones
Pronouns: He/Him

The Image disappears when talking to an npc

Postby Marioman2007 » Tue Feb 09, 2021 3:22 am

So, I wanted to make a custom hud. But I got a issue where the loaded image disappears when I talk to a npc.
Here's a Gif:
(See the pipe)
Spoiler: show
Image
The Code:
Spoiler: show

Code: Select all

local coin = Graphics.loadImage(Misc.resolveFile("modernhud-2.png"))

function onTick()
    Graphics.draw{
        type = RTYPE_IMAGE,
        image = coin,
        x = 500,
        y = 100,
        priority = 0,
    }
end

Can anyone Help me?

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9865
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: The Image disappears when talking to an npc

Postby Emral » Tue Feb 09, 2021 3:48 am


Marioman2007
2025 Egg Hunter
2025 Egg Hunter
Posts: 530
Joined: Tue Aug 25, 2020 3:19 am
Flair: Dr. Bones
Pronouns: He/Him

Re: The Image disappears when talking to an npc

Postby Marioman2007 » Tue Feb 09, 2021 4:06 am

Enjl wrote:
Tue Feb 09, 2021 3:48 am
Don't use onTick for drawing. https://docs.codehaus.moe/#/reference/lunalua-events
So, what is the best to use?

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9865
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: The Image disappears when talking to an npc

Postby Emral » Tue Feb 09, 2021 4:09 am

Read the page. Don't have to read far.


Return to “LunaLua Help”

Who is online

Users browsing this forum: No registered users and 1 guest

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari