Homebrew [Release] Lua Player Plus 3DS (lpp-3ds) - LUA interpreter for 3DS

  • Thread starter Thread starter Rinnegatamante
  • Start date Start date
  • Views Views 187,241
  • Replies Replies 1,199
  • Likes Likes 35
int,int Controls.readCirclePad(void) - Get X,Y position of Circle Pad.

Sample usage: x,y = Controls.readCirclePad()

The x is probably higher, the farther right the pad is, for y it's the probably the lower it is.
Sensibility and non calibratedness are also probably not taken into account.
 
Last edited by The_Marcster,
  • Like
Reactions: Seriel
int,int Controls.readCirclePad(void) - Get X,Y position of Circle Pad.

Sample usage: x,y = Controls.readCirclePad()

The x is probably higher, the farther right the pad is, for y it's the probably the lower it is.
Sensibility and non calibratedness are also probably not taken into account.
Is 0,0 the center, or does that go to one of the corners?
 
  • Like
Reactions: Seriel
Is 0,0 the center, or does that go to one of the corners?

Yes, 0 - 0 is the center, here's an example:
Code:
local x, y
Graphics.init()

while true do
    Screen.refresh()
    Screen.clear(TOP_SCREEN)
    Screen.clear(BOTTOM_SCREEN)
 
    x, y = Controls.readCirclePad() -- max for both is 156
 
    x = math.floor(x / 4 + 0.5) -- to fit on screen
    y = - math.floor(y / 4 + 0.5) -- to fit on screen, negative because input is inverted
 
    Screen.fillRect(200 + x - 3, 200 + x + 3, 120 + y - 3, 120 + y + 3, Color.new(255,0,0), TOP_SCREEN) -- 200 is half of top screen width, 120 is half of top screen height
    Screen.debugPrint(10, 10, 'x: ' .. x, Color.new(255,255,255), TOP_SCREEN)
    Screen.debugPrint(10, 25, 'y: ' .. y, Color.new(255,255,255), TOP_SCREEN)
 
    Screen.waitVblankStart()
    Screen.flip()
 
    if Controls.check(Controls.read(), KEY_B) then
        System.exit()
    end
end

Edit:
Also, Rinnegatamante, the Graphics.drawCircle function doesn't seem to work properly. Citra and an actual 3DS just tell me that more arguments are required, even though I use the 4 from the documentation...
 
Last edited by The_Marcster,
  • Like
Reactions: Seriel
Yes, 0 - 0 is the center, here's an example:
Code:
local x, y
Graphics.init()

while true do
    Screen.refresh()
    Screen.clear(TOP_SCREEN)
    Screen.clear(BOTTOM_SCREEN)

    x, y = Controls.readCirclePad() -- max for both is 156

    x = math.floor(x / 4 + 0.5) -- to fit on screen
    y = - math.floor(y / 4 + 0.5) -- to fit on screen, negative because input is inverted

    Screen.fillRect(200 + x - 3, 200 + x + 3, 120 + y - 3, 120 + y + 3, Color.new(255,0,0), TOP_SCREEN) -- 200 is half of top screen width, 120 is half of top screen height
    Screen.debugPrint(10, 10, 'x: ' .. x, Color.new(255,255,255), TOP_SCREEN)
    Screen.debugPrint(10, 25, 'y: ' .. y, Color.new(255,255,255), TOP_SCREEN)

    Screen.waitVblankStart()
    Screen.flip()

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

Edit:
Also, Rinnegatamante, the Graphics.drawCircle function doesn't seem to work properly. Citra and an actual 3DS just tell me that more arguments are required, even though I use the 4 from the documentation...

You right, my fault, just use another argument as stub (like nil).
 
  • Like
Reactions: Seriel
Yeah, you have to use FIRST GPU rendering.

Thank you :)

how do i install this?

"As always, using a LUA interpreter is very simple, you just have to rename lpp-3ds-3dsx as MyHomebrewName.3dsx, put it in /3ds/MyHomebrewName/ folder and start writing your code in /3ds/MYHomebrewName/index.lua." - This is from the first page of the thread. Please read the instructions before asking questions like these. If you're still having problems, please ask a more specific question so we can help you better.
 
  • Like
Reactions: Seriel
Could someone build lastest commit (I want to use the io.size fix)? I tried to build myself, and I get a bunch of errors, such as: c:/devkitPro/msys/aemstro_as.py file not found (Yes I have devkitpro installed and working with other homebrews, but that file isn't there) also I get: arm-none-eabi-strip not a valid command.
 
  • Like
Reactions: Seriel
How the bmp should be saved? if i save in gimp and i use the standart saving method (32bit a8 r8 g8 b8) then it shows garbled mess

EDIT: Screw the question

How do i prevail that the RAM runs full?
https://github.com/ddraco/PKDexter/blob/master/index.lua

im pretty fresh to lua put dont know how to do that

ediedit2: screw the entire post. worked it out by myself
 
Last edited by ddraco,
the final question (i hope) howto get wordwraps? i define some text="overly long text" per an outside file and want to add automaticaly an wordwrap when it reaches the end of the scree so that its not writing over the screen end but at the begining of the next row
 
the final question (i hope) howto get wordwraps? i define some text="overly long text" per an outside file and want to add automaticaly an wordwrap when it reaches the end of the scree so that its not writing over the screen end but at the begining of the next row

I think it was usin \n when you want to jump, not sure.
 
Nothing like an Text Module that Do this automaticaly? Cant this be builded in The responsable modules?

There are way too many factors in play to make it worth it for @Rinnegatamante to implement this in LPP. Changing fonts, handling line height parameter, etc. If you want this you need a way to measure how many pixels your text will take up and figure out where to split the string based on that, then render each line individually.
 

Site & Scene News

Popular threads in this forum