Calculator Community > Lua

Updating only one object on screen

(1/1)

ingalls:
Is there anyway to update a specific object on the screen instead of the entire screen. I've been wrangling with this one for most of the day and haven't been able to figure it out!

Cheers
Ingalls

EDIT: basically the problem I'm having is that I'm trying to fill up the whole screen with tiles for a game. The lua engine currently has to pause to be able to draw the tiles. Whenever I move the character tile, it has to redraw the whole screen just to move a single character tile. Is there anyway change the screen without completely refreshing it. Whenever on.paint(gc) is called it clears the screen and redraws...

ingalls:

--- Quote ---while(Exit)
   ------- Some OS routines here

    ---- Begin of Event link
   buffer:captureDataFromKeyPad()            --  (N) some underground routines to catch events
   if buffer.charInput ~= "" then            --  (N)
      on.charIn(buffer.charInput)
      buffer.charInput= ""            --  (N)
   end
   if buffer.arrowKey ~= "" then            --  (N)
      on.arrowKey(buffer.arrowKey)
      buffer.arrowKey = ""            --  (N)
   end
   ----- etc ...    
   if platform.window.isInvalidate then
       platform.gc():purge()           --  (N) Empty buffer before starting to draw
      on.paint(platform.gc())         -- save all the things we have to draw
       platform:paint()             --  (N) draw all those things
      platform.window.isInvalidate = false    -- say that the window has been drawn
   end
   ----- End of Event link
end

--- End quote ---

This is taken from hackspire, just to clarify what I'm asking. I'm looking to find a way to stop the :purge() from happening. I want to be able to add to the drawing after the window  has been drawn.

Adriweb:
Sadly enough, TI chose to implement the graphic engine buffer-based (as a stack), so you have to chose what to put in the stack, and the on.paint(gc) will redraw the buffer each time it gets called, and so, there is no way to only refresh one thing at a time ... :(

ingalls:
They give us a decent language to program in but restrict it so much to make it almost impossible to program games whose graphics take up the whole screen... *Sigh*

Anyways, that's nice to know, thanks for the response, I won't spend my time tearing out my hair trying to firgure it out

Cheers
Ingalls

Navigation

[0] Message Index

Go to full version