Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
  • 0
iceman11a

Wanting samples for lua in OC

Question

Finding samples so that I can learn from is not an easy thing to do. I'm looking for simple samples to learn from. Some thing that can teach me how to display colors on the screen and words. How to monitor storage tanks and energy and pressure tubes. I'm not looking for some one to write the code for me. It would be nice if I can find some one that can help me with the code.
 
Ice
 
Edited by the authorities: please don't randomly post links to unrelated sites.

Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Look here for all the documentation on the screen and gpu components. Basically you will have to bind the gpu to the relevant screen you want to manipulate and call the functions available in the gpu library to manipulate the monitor for drawing and setting text.

i.e 

local component = require "component"
local gpu = component.gpu -- you must have a gpu installed in your computer! This is the primary if there is more then one. It is bound by default to the fist screen it finds.

gpu.set( 1,1,"Hello world" )
gpu.fill(2,2,4,4,"+")

gpu functions

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.