Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
-- Draconic Core Energy Reader app -- IDs for buttons local testBtnId = "test_energy_storage" -- padding for top-left placement local PADDING_X, PADDING_Y = 3, 4 -- state variables -- views local function rootView(ctx) return { draw = function(ctx, mon) local btnW, btnH = 12, 3 local x, y = PADDING_X, PADDING_Y ctx.libs().button.addButton(x, y, btnW, btnH, testBtnId, colors.lime, colors.gray, true, "test", "", x + 2, y + 1, "") ctx.libs().button.drawButton(testBtnId, mon) end, touch = function(ctx, x, y) if ctx.libs().button.isWithinBoundingBox(x, y, testBtnId) then end end } end local views = { root = rootView } return { id = "energy_storage", name = "Core", protocol = "energy_storage", receive = function(ctx, sender, message) end, create = function(ctx) end, destroy = function(ctx) end, resume = function(ctx) end, suspend = function(ctx) end, update = function(ctx, dt) end, draw = function(ctx, mon, viewId) local v = views[viewId] if v and v(ctx).draw then v(ctx).draw(ctx, mon) end end, touch = function(ctx, x, y, viewId) local v = views[viewId] if v and v(ctx).touch then v(ctx).touch(ctx, x, y) end end }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)