Lua Port

Post here questions, problems and suggestions in English language
  • Latest version doesn't create console window. Instead you should to create window and buttons, and check keyboard and screen events. If you need details, I'll write it here later:)
    Also, if you really need console input and output, I'll try to add these functions to KOS port :)
    Thnak you for your response!
  • It would be nice to have textmode.

    It will enable really fast porting of existing lua apps.

    I will also play with play with nateve GUI, maybe there will be some nice app from me sometimes.
  • Okay! Now I have other plans, but I think I can add console input and output before Xmas.
    You can't draw pictures from Lua in Native GUI yet, but I can add almost any function you want. Just write what you need :)
    Also it'll be nice to add Lua Sockets, but there are no realization of POSIX sockets in Kolibri yet.
  • Hi, severak! I updated port to 5.2.0 and added new commands:
    copen() - create console window
    cclose() - close console window
    cprintf("string",value,anything,separated_by_commas) - print anything
    val=cgets() - get string from keyboard
    Link to download: download/file.php?id=3105
  • It would be really nice to have some GUI support for Lua programs.
    What about creating the bindings for the Kolibri API?
  • Sorry, I didn't thought that somebody except me would need Lua :) So, I'll translate some info from Lua topic ( viewtopic.php?f=45&t=1663&p=39354#p39354 )

    Some language bindings:

    Code: Select all

    --console functions
    copen() - open console
    cclose() - close console
    cprintf() - printf something
    cgets() - get string
    
    --window functions
    paintstart() --begin window redraw 
    paintend() --finish window redraw
    window(10,10,153,180,65069280) --create window
    textout(3,13,0,"LuaCalc") --print text
    makebutton(6,60,20,20,17,13619151) --create/delete button (take a look at KolibriOS system functions)
    waitevent() --wait for event
    checkevent() --check for event (take a look at sysfuncs too)
    getkey() --get pressed key from keyboard
    getbutton() --get code of pressed screen button
    sysexit() --stop execution
    systime() - get time (in BCD)
    sysdate() --get date (in BCD)
    drawpixel(x,y,c) --nuff said :)
    drawline(x,y,x1,y1,c) 
    
    There are some examples in archive, btw.
  • Who is online

    Users browsing this forum: No registered users and 36 guests