[Help] HUD API Images not rendering.

User avatar
Traxie21
Member
 
Posts: 753
Joined: Mon Dec 31, 2012 10:48
Location: McKinney, Texas U.S.A.

[Help] HUD API Images not rendering.

by Traxie21 » Thu Apr 18, 2013 18:31

Here's the code I'm trying to use ATM, I've tried everything I can think of, but all that happens is the text string is rendered where the image should be.

Code: Select all
user:hud_add( {
                type = "image",
                position = {x=0.8, y=0.02},
                name = "Potion Effect Notification",
                text = "potions_hud_bg.png",
                scale = {x=2, y=2},
            })
 

User avatar
BlockMen
Developer
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
Location: Germany
GitHub: BlockMen

by BlockMen » Thu Apr 18, 2013 18:37

Same problem. My hud def is:

Code: Select all
local myhud =
{
    type = "image",
    position = {x=0.5, y=0.5},
    scale = {x=2, y=2},
    text = {"test_sand.png"},
}


When i use type = "text" and text = "test" it works fine
 

User avatar
Traxie21
Member
 
Posts: 753
Joined: Mon Dec 31, 2012 10:48
Location: McKinney, Texas U.S.A.

by Traxie21 » Thu Apr 18, 2013 19:25

From IRC:

<hmmm>: [type field] is actually hud_elem_type.

The documentation is incorrect, submitting pull request.

Fixed code:
Code: Select all
user:hud_add( {
               hud_elem_type = "image",
                position = {x=0.8, y=0.02},
                name = "Potion Effect Notification",
                text = "potions_hud_bg.png",
                scale = {x=2, y=2},
            })
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Fri Apr 19, 2013 08:55

Any screenshots of working HUDs? ;)
Last edited by 4aiman on Fri Apr 19, 2013 08:55, edited 1 time in total.
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Fri Apr 19, 2013 10:54

Oh! HUDs can be used in armr and food mods.
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

User avatar
Traxie21
Member
 
Posts: 753
Joined: Mon Dec 31, 2012 10:48
Location: McKinney, Texas U.S.A.

by Traxie21 » Fri Apr 19, 2013 11:57

Potions will have a HUD as soon as I finalize it.
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Fri Apr 19, 2013 12:13

Nice. Maybe make a function where you can say what certain nodes drop xp maybe. Then you can use that to brew potions. I might be making an brewing stand for potions.
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

User avatar
BlockMen
Developer
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
Location: Germany
GitHub: BlockMen

by BlockMen » Fri Apr 19, 2013 13:13

I made a simple test mod for the new LUA HUD: Hungry

---


Traxie21 wrote:From IRC:

<hmmm>: [type field] is actually hud_elem_type.

The documentation is incorrect, submitting pull request.

Fixed code:
Code: Select all
user:hud_add( {
               hud_elem_type = "image",
                position = {x=0.8, y=0.02},
                name = "Potion Effect Notification",
                text = "potions_hud_bg.png",
                scale = {x=2, y=2},
            })



Thanks btw.
Last edited by BlockMen on Fri Apr 19, 2013 13:14, edited 1 time in total.
 


Return to WIP Mods



Who is online

Users browsing this forum: Gael de Sailly, jSnake and 2 guests