Homebrew LPP Breaks When I Try to Show an Image

BringusStudios

Well-Known Member
OP
Member
Joined
Oct 3, 2011
Messages
442
Trophies
1
Age
24
Website
bringus.studio
XP
608
Country
United States
I'm not really sure what's up with this. Do the .png files need to be in some special format, or am I just doing this wrong?

EDIT: "/assets/question.png" is supposed to be "/question.png" in index.lua.
 

Attachments

  • test.zip
    726.6 KB · Views: 168
Last edited by BringusStudios,

Megalegacy98

Well-Known Member
Member
Joined
Aug 11, 2015
Messages
505
Trophies
0
Location
United States
XP
430
Country
United States
Maybe position it like this?
Code:
question = Screen.loadImage("/assets/question.png")
while true do
   Screen.waitVblankStart()
   Screen.refresh()
   Screen.drawImage(400,240,question,TOP_SCREEN)
   Screen.debugPrint(0,0,"Press B to exit",Color.new(255,255,255),BOTTOM_SCREEN)
   Screen.flip()
 

keanutah

Well-Known Member
Member
Joined
Sep 18, 2015
Messages
173
Trophies
0
Age
34
XP
192
Country
United States
Nope, still black screen. My text isn't even showing up.

You have a few different problems in your code. I didn't run this since I'm not on the right computer but give this a shot :)

Code:
question = Screen.loadImage(System.currentDirectory().."/assets/question.png")

while true do
  Screen.waitVblankStart()
  Screen.refresh()

   Screen.drawImage(0,0,question,TOP_SCREEN) -- you want the coordinates to the start x position and the start y position. 0,0 would be the top left corner of the screen
   Screen.debugPrint(0,0,"Press B to exit",Color.new(255,255,255),BOTTOM_SCREEN)

  if Controls.check(Controls.read(),KEY_B) then
  System.exit()
  end

   Screen.flip()
end
 
Last edited by keanutah,

730

Professional Shitposter
Member
Joined
Apr 2, 2015
Messages
485
Trophies
0
XP
628
Country
Argentina
Nope and nope... If someone wants to just make a code from scratch that does nothing but display a png I can go off of that.
Code:
img = Screen.loadImage(imageLocation)
while true do
    Screen.waitVblankStart()
    Screen.refresh()
    Screen.clear(TOP_SCREEN)
    --Screen.clear(BOTTOM_SCREEN) <-- if necessary
    Screen.drawImage(0, 0, img, TOP_SCREEN)
    Screen.flip()
end

edit: ehh shit clean() is actually clear()
 
Last edited by 730,

BringusStudios

Well-Known Member
OP
Member
Joined
Oct 3, 2011
Messages
442
Trophies
1
Age
24
Website
bringus.studio
XP
608
Country
United States
Have you tried using any of the example lua files that are provided with the download?
Yeah but the image one doesn't include "file.bmp"

--------------------- MERGED ---------------------------

Code:
img = Screen.loadImage(imageLocation)
while true do
    Screen.waitVblankStart()
    Screen.refresh()
    Screen.clear(TOP_SCREEN)
    --Screen.clear(BOTTOM_SCREEN) <-- if necessary
    Screen.drawImage(0, 0, img, TOP_SCREEN)
    Screen.flip()
end

edit: ehh shit clean() is actually clear()
Nope... this is driving me crazy!
 

730

Professional Shitposter
Member
Joined
Apr 2, 2015
Messages
485
Trophies
0
XP
628
Country
Argentina
Yeah but the image one doesn't include "file.bmp"

--------------------- MERGED ---------------------------


Nope... this is driving me crazy!
You are clearly doing something very wrong, most likely your image placement.
 

keanutah

Well-Known Member
Member
Joined
Sep 18, 2015
Messages
173
Trophies
0
Age
34
XP
192
Country
United States
Can you make a .zip file of everything EXACTLY coded and placed correctly?

So all I did was take the code I placed above and move your question.png into an /assets folder. Works fine in Citra.
 

Attachments

  • test.zip
    698.6 KB · Views: 142

730

Professional Shitposter
Member
Joined
Apr 2, 2015
Messages
485
Trophies
0
XP
628
Country
Argentina
Can you make a .zip file of everything EXACTLY coded and placed correctly?
Not at home right now. All you should know is that when loading the image, "/img.png" would try to load img.png from the root. System.currentDirectory() returns the directory where the 3dsx is located, therefore System.currentDirectory() .. "/img.png" ends up loading "3ds/<homebrew>/img.png".
Also is your script named "index.lua" and placed next to the lpp 3dsx?
 

BringusStudios

Well-Known Member
OP
Member
Joined
Oct 3, 2011
Messages
442
Trophies
1
Age
24
Website
bringus.studio
XP
608
Country
United States
So all I did was take the code I placed above and move your question.png into an /assets folder. Works fine in Citra.
This works perfectly. I know the picture was misplaced in the code, the .zip was missing the assets folder, but the one I was testing was ordered just like this... Oh well, thanks for getting it to work!
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    AncientBoi @ AncientBoi: lol, Okies. Family graveyard is that way 👉