- Sky
- Blueberry
- Slate
- Blackcurrant
- Watermelon
- Strawberry
- Orange
- Banana
- Apple
- Emerald
- Chocolate
- Charcoal
SilentCid
-
Content Count
2 -
Joined
-
Last visited
Posts posted by SilentCid
-
-
Greetings,
I'm new to Lua but familiar with some of the basics. I'm using this library for the GUI, but not sure on the proper procedure on updating the items on the screen. I have an adapter attached to an IC2 fluid reactor and want to call reactor.getHeat() to get the latest temps and update this child:
application:addChild(GUI.text(5, 5, 0xFFFFFF, currentTemps))
If someone can kindly point me in the right direction I think I can go from there. The rest of my code is pretty basic which I haven't played around much on it.
local GUI = require("GUI") local component = require 'component' local reactor = component.reactor_chamber local currentTemps = reactor.getHeat() -------------------------------------------------------------------------------- -- Create new application local application = GUI.application() -- Add panel that fits application application:addChild(GUI.panel(1, 1, application.width, application.height, 0x262626)) -- Add smaller panels application:addChild(GUI.panel(4, 2, 23, 4, 0x880000)) application:addChild(GUI.text(5, 3, 0xFFFFFF, "Current Reactor Temps")) application:addChild(GUI.text(5, 5, 0xFFFFFF, currentTemps)) -------------------------------------------------------------------------------- application:draw(true) application:start()
Updating items on screen
in Programming
Posted
Thank you for your help. Didn't seem to want to update that variable. It will get the first reading when you first run the program up but doesn't want to update properly after that. I may have to refer to the library creator on this.