Image issues

This is the place for discussion and support for LunaLua and related modifications and libraries.
Forum rules
Before you make a topic/post, consider the following:
-Is there a topic for this already?
-Is your post on topic/appropriate?
-Are you posting in the right forum/following the forum rules?
The0x539
Eerie
Eerie
Posts: 751
Joined: Fri Jan 22, 2016 8:02 pm

Re: Image issues

Postby The0x539 » Sat Oct 07, 2017 2:27 pm

Yes, people know how to fix this. Read a tutorial.

PixelPest
Raccoon Mario
Raccoon Mario
Posts: 7111
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Contact:

Re: Image issues

Postby PixelPest » Sat Oct 07, 2017 2:42 pm

I know I said that I wouldn't help you again unless you read a tutorial, but I will say one more thing: you're still making the same mistakes over and over again; you've done this same thing at least five times and still haven't listened to what people have told you. If you don't read a tutorial you're going to hit a point where you're unable to get any more help from people directly as you're going to have pissed off everyone who has the potential to help you. You're pretty close to that point

The0x539
Eerie
Eerie
Posts: 751
Joined: Fri Jan 22, 2016 8:02 pm

Re: Image issues

Postby The0x539 » Sat Oct 07, 2017 5:59 pm

TheKidCodee wrote:
PixelPest wrote:I know I said that I wouldn't help you again unless you read a tutorial, but I will say one more thing: you're still making the same mistakes over and over again; you've done this same thing at least five times and still haven't listened to what people have told you. If you don't read a tutorial you're going to hit a point where you're unable to get any more help from people directly as you're going to have pissed off everyone who has the potential to help you. You're pretty close to that point
I was already reading the PGE wiki before you said that. And i still am. Now please let me figure out how to layout LuaImageResource.
Misc.resolveFile accepts a filename as a string and returns a filepath as a string.
Graphics.loadImage accepts a filepath as a string and returns a LuaImageResource.
Graphics.drawImage accepts a LuaImageResource and coordinates and draws the image at that location.

The0x539
Eerie
Eerie
Posts: 751
Joined: Fri Jan 22, 2016 8:02 pm

Re: Image issues

Postby The0x539 » Sun Oct 08, 2017 2:21 am

TheKidCodee wrote:
The0x539 wrote:
TheKidCodee wrote: I was already reading the PGE wiki before you said that. And i still am. Now please let me figure out how to layout LuaImageResource.
Misc.resolveFile accepts a filename as a string and returns a filepath as a string.
Graphics.loadImage accepts a filepath as a string and returns a LuaImageResource.
Graphics.drawImage accepts a LuaImageResource and coordinates and draws the image at that location.
Ok. But whats a LuaImageResource? now i know its not a filepath
LuaImageResource is, as far as you should be concerned, a type, just like boolean/number/table/function. Technically it's userdata, or in B4 a table, but for your purposes just think of it as a type of its own.

The0x539
Eerie
Eerie
Posts: 751
Joined: Fri Jan 22, 2016 8:02 pm

Re: Image issues

Postby The0x539 » Mon Oct 09, 2017 11:14 pm

TheKidCodee wrote:
The0x539 wrote:
TheKidCodee wrote: Ok. But whats a LuaImageResource? now i know its not a filepath
LuaImageResource is, as far as you should be concerned, a type, just like boolean/number/table/function. Technically it's userdata, or in B4 a table, but for your purposes just think of it as a type of its own.

Code: Select all

function onInputUpdate()
Graphics.loadImage("Hudpics\\score.png")
end

Code: Select all

function onNPCKill()
	8 + 3
end

HenryRichard
Birdo
Birdo
Posts: 2843
Joined: Mon Dec 23, 2013 12:09 pm
Flair: Is this where I type my password?
Contact:

Re: Image issues

Postby HenryRichard » Thu Oct 12, 2017 10:20 pm

For one, you're loading the same exact image every single frame. But then you're not assigning it to anything. It's like you're ordering the same thing off Amazon every day and then throwing every single one in the trash can. It's just as useful as the code snippet The0x539 posted, which is to say it's not useful in the slightest.

The0x539
Eerie
Eerie
Posts: 751
Joined: Fri Jan 22, 2016 8:02 pm

Re: Image issues

Postby The0x539 » Sat Oct 14, 2017 4:35 pm

TheKidCodee wrote:

Code: Select all

local Hudscore = Graphics.loadImage(Misc.resolveFile(HUDpics/score))
I dont rememeber it that much so chances are some of the mistakes i made here might not in my actual code. I cant go and check right now
HUDpics/score should be enclosed in quotes and have a file extension. Right now it's interpreting HUDpics as a variable and score as a variable, and trying to divide HUDpics by score. With quotes, it'll be interpreted as the string of text that you mean for it to be.
That aside, this is some of the most correct LunaLua code you've ever written.

The0x539
Eerie
Eerie
Posts: 751
Joined: Fri Jan 22, 2016 8:02 pm

Re: Image issues

Postby The0x539 » Sun Oct 15, 2017 12:07 am

TheKidCodee wrote:
The0x539 wrote:
TheKidCodee wrote:

Code: Select all

local Hudscore = Graphics.loadImage(Misc.resolveFile(HUDpics/score))
I dont rememeber it that much so chances are some of the mistakes i made here might not in my actual code. I cant go and check right now
HUDpics/score should be enclosed in quotes and have a file extension. Right now it's interpreting HUDpics as a variable and score as a variable, and trying to divide HUDpics by score. With quotes, it'll be interpreted as the string of text that you mean for it to be.
That aside, this is some of the most correct LunaLua code you've ever written.
I was back hours ago but i didnt come to the fourms. This is what it actually looks like.

Code: Select all

local hudscore = Graphics.loadImage(Misc.resolvefile("HUDpics/score.png))
you think you post something but you actually didnt godamnit
You're missing one thing (you started something but never ended it

The0x539
Eerie
Eerie
Posts: 751
Joined: Fri Jan 22, 2016 8:02 pm

Re: Image issues

Postby The0x539 » Sun Oct 15, 2017 1:09 am

TheKidCodee wrote:
The0x539 wrote:
TheKidCodee wrote: I was back hours ago but i didnt come to the fourms. This is what it actually looks like.

Code: Select all

local hudscore = Graphics.loadImage(Misc.resolvefile("HUDpics/score.png))
you think you post something but you actually didnt godamnit
You're missing one thing (you started something but never ended it

Code: Select all

local hudscore = Graphics.loadImage(Misc.resolvefile("HUDpics/score.png"))
*Again What it Actually looks like.
This is valid, correct, and good practice, assuming the file exists. hudscore is now a variable ready to be fed into a function from the Graphics.draw family.

The0x539
Eerie
Eerie
Posts: 751
Joined: Fri Jan 22, 2016 8:02 pm

Re: Image issues

Postby The0x539 » Sun Oct 15, 2017 1:19 am

TheKidCodee wrote:
The0x539 wrote:
TheKidCodee wrote:

Code: Select all

local hudscore = Graphics.loadImage(Misc.resolvefile("HUDpics/score.png"))
*Again What it Actually looks like.
This is valid, correct, and good practice, assuming the file exists. hudscore is now a variable ready to be fed into a function from the Graphics.draw family.
Will it show?
It will show if you draw it in one of the main event loop callbacks.

Kley
Edge
Edge
Posts: 694
Joined: Mon Feb 24, 2014 11:00 am
Flair: Robot

Re: Image issues

Postby Kley » Mon Oct 16, 2017 9:09 pm

TheKidCodee wrote:
The0x539 wrote:
TheKidCodee wrote: Will it show?
It will show if you draw it in one of the main event loop callbacks.
im sorry?
Sorry for what?

The0x539
Eerie
Eerie
Posts: 751
Joined: Fri Jan 22, 2016 8:02 pm

Re: Image issues

Postby The0x539 » Sun Oct 22, 2017 6:05 pm

TheKidCodee wrote:
Kley wrote:
TheKidCodee wrote: im sorry?
For not understanding BUT! Its drawImagetoScene right?
No, check your capitalization. As for whether you should use the function you're trying to say, it depends on whether the coordinates you're drawing at are a position in the world or a position on the screen.

The0x539
Eerie
Eerie
Posts: 751
Joined: Fri Jan 22, 2016 8:02 pm

Re: Image issues

Postby The0x539 » Sun Oct 22, 2017 6:07 pm

TheKidCodee wrote:
The0x539 wrote:
TheKidCodee wrote: For not understanding BUT! Its drawImagetoScene right?
No, check your capitalization. As for whether you should use the function you're trying to say, it depends on whether the coordinates you're drawing at are a position in the world or a position on the screen.
On screen
Then anything with the word "scene" in it is the wrong function.


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 5 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari