Search found 16 matches

by Nils
Thu Aug 25, 2005 3:42 am
Forum: PSP Lua Player Development
Topic: Rounding Decimals
Replies: 4
Views: 3693

try that.

Code: Select all

function math.round(num, idp)
  local mult = 10^(idp or 0)
  return math.floor(num  * mult + 0.5) / mult
end
x = 8.13
math.round(x) = 8
y = 8.52
math.round(y) = 9
by Nils
Thu Aug 18, 2005 10:48 pm
Forum: PSP Lua Player Development
Topic: Lua Player for PSP
Replies: 351
Views: 308996

:) Great, network :)

Shine's mandelbrot script turned me on, so here my fractal tree demo :
Image

Left of right to generate a new tree.
Get the source here.

I love lua !
by Nils
Sun Aug 14, 2005 7:47 pm
Forum: PSP Lua Player Development
Topic: Lua Player for PSP
Replies: 351
Views: 308996

Thx Shine... i did indeed drop the theScene and everything on screen. Now the screen:clear() works.
Seems weird though that theScene:clear() didnt work.
I'm off to code more ... :)
by Nils
Sun Aug 14, 2005 5:27 pm
Forum: PSP Lua Player Development
Topic: Lua Player for PSP
Replies: 351
Views: 308996

Well, lol. I managed to get clear working, but NOT in the way it should: it behaves strangely: i had to do a screen:clear() in my main while loop, AND a theScene:clear() in my rotate function that is called just after that, meaning it clears screen, then clears theScene. It doesnt work with one or t...
by Nils
Sun Aug 14, 2005 5:14 pm
Forum: PSP Lua Player Development
Topic: Lua Player for PSP
Replies: 351
Views: 308996

"confusing tip"...i cannot get clear() to work and that was the only way to get rid of the "press restart" bug in 0.7. I tried all possible ways of clear() with nevyn on IRC. Tried screen:clear(), screen:clear(Color.new(0,0,0)), screen:clear(Color.new(0,0,0,255)) myEmptygraphic:c...
by Nils
Sun Aug 14, 2005 3:05 pm
Forum: PSP Lua Player Development
Topic: Lua Player for PSP
Replies: 351
Views: 308996

Try that at beginning... i ran into this bug also. -- this to prevent the press start to restart display bug layout =Image.createEmpty(480, 272) layout:fillRect(0, 0 , 480, 272, Color.new(0,0,0)) screen:blit(0, 0, layout&#41...
by Nils
Sun Aug 14, 2005 2:26 pm
Forum: PSP Lua Player Development
Topic: Lua Player PC Preview?
Replies: 25
Views: 21687

u can try web lua (lua 4 only) for tiny bits of your code or install Lua Cheia on your pc.


Useful links ...
http://luaplayer.org
http://lua-users.org/wiki/LuaAddons
by Nils
Sun Aug 14, 2005 8:59 am
Forum: PSP Lua Player Development
Topic: Lua Player for PSP
Replies: 351
Views: 308996

screen:clear() or myemptygraphic:clear() doesnt work for me; nobody uses that, not even you in snake but at newgame ?
by Nils
Sun Aug 14, 2005 8:45 am
Forum: PSP Lua Player Development
Topic: Lua Player for PSP
Replies: 351
Views: 308996

F34R, add a fillrect with black color in the main while loop, in order to erase previous smiley

Shine > seems interesting :)
" Libart has full support for RGB and RGBA image operations, including rotation, scaling, skewing, and alpha compositing."

Yay !
by Nils
Sun Aug 14, 2005 7:20 am
Forum: PSP Lua Player Development
Topic: Lua Player for PSP
Replies: 351
Views: 308996

F34R, try that: System.usbDiskModeActivate() background = Image.load("background.png") smiley = Image.load("smiley.png") screen:blit(0, 0, background, 0, 0, background:width(), background&...
by Nils
Sun Aug 14, 2005 5:59 am
Forum: PSP Lua Player Development
Topic: Lua Player for PSP
Replies: 351
Views: 308996

Shine, Nevin, is it possible to add a function inside LUA to rotate an image ? I've been coding a few functions, like reading the pixels 1 by 1 of a given image, storing the x,y,color in a table, then recreating the image with that array dot by dot, and modifying x,y in that array live applying 2d s...
by Nils
Sat Aug 13, 2005 3:39 pm
Forum: PSP Lua Player Development
Topic: Lua Player for PSP
Replies: 351
Views: 308996

Hi ... My first contrib to luaplayer. Shine, you missed that in your apps ! So here is the classic 3d wireframe cube demo made on all systems / languages... lua for psp had to have it :) http://lua.ventoline.com/screenshot3dcube.gif Download it here : - full with lua 0.7 embedded - lua script versio...
by Nils
Sat Aug 13, 2005 8:27 am
Forum: PSP Lua Player Development
Topic: Lua Player for PSP
Replies: 351
Views: 308996

Ok.. been running a few tests to see what was the fastest loop. Somehow, as usual, it seems that while - is the fastest around. System.usbDiskModeActivate() color = { red = Color.new(255,0,0); green = Color.new(0, 255, 0); blue = Color.new(0,0,255); } local q = 0 local j = 0 local time = os.clock() ...
by Nils
Sat Aug 13, 2005 7:59 am
Forum: PSP Lua Player Development
Topic: Lua Player for PSP
Replies: 351
Views: 308996

Excellent .... thx Shine. Lua's doc is really awful and so incomplete. We lack a math.int or math.round .. somehow founded that one, but would be nice to implement directly in lua: function math.round(num, idp) local mult = 10^(idp or 0) return math.floor(num * mult + 0.5) / mult end idp being the n...
by Nils
Sat Aug 13, 2005 7:21 am
Forum: PSP Lua Player Development
Topic: Lua Player for PSP
Replies: 351
Views: 308996

Any way to implement a millisecond function in lua ? It really lacks it...
We have os.time(), which returns the time in seconds....
How about a os.timems(), which returns the time in milliseconds ?
by Nils
Thu Aug 04, 2005 5:37 am
Forum: PSP Lua Player Development
Topic: Lua Player for PSP
Replies: 351
Views: 308996

Great work Shine on the Lua player :) I started to toy around with it, even if documentation on lua.org website is really bad. Development is easy, but one looses too much time sending to psp / testing / reconnecting psp resending... I ended up testing bits of my code on weblua (http://doris.sourcef...