tommyroyall

Frame_Buffer/Screen Class Ideas.

Oct 13th, 2012
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.99 KB | None | 0 0
  1. --Sledger721's Frame Buffer/Screen Class Idea.
  2. cScreen, cFrame_buffer = graphics.init() -- Initiating graphics.
  3. cFrame_buffer.bState = false -- Setting the state switch to false.
  4.  
  5. --Content would be put into cFrame_buffer like:
  6. cFrame_buffer.tConent=some;content;to;be;parsed;blah;blah;etc -- Filling it with content.
  7.  
  8. while true do
  9.     if cFrame_buffer.bState == true then -- The only reason that I have it switch around with the state boolean is so that the user could see this script and have more control, most likely to add a parser to it.
  10.         parsed_content = graphics.parse(cFrame_buffer.tContent) -- Parsing it.
  11.         cScreen.contents = parsed_content -- If the state is true, lay the content of the buffer onto the screen.
  12.     end
  13.     if cFrame_buffer.tContent ~= nil then
  14.         cFrame_buffer.bState = true -- If there is any content in the buffer, then tell the state to be true.
  15.     end
  16.     graphics.render(cScreen) -- Render the screen class.
  17.     graphics.buffer(cFrame_buffer) -- Buff the buffer class.
  18. end
Advertisement
Add Comment
Please, Sign In to add comment