summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPiotr Dobrowolski <admin@tastycode.pl>2017-04-23 12:20:49 +0200
committerPiotr Dobrowolski <admin@tastycode.pl>2017-04-23 12:20:49 +0200
commit62527b727bfa853336d27bd107f1a239228bf1a2 (patch)
tree5529d49ed80b28bd2c562d12d23f8211827da074
parente72e1a185290683953d671ade05fc06591ca55e5 (diff)
downloadlove2d-signage-62527b727bfa853336d27bd107f1a239228bf1a2.tar.gz
love2d-signage-62527b727bfa853336d27bd107f1a239228bf1a2.tar.bz2
love2d-signage-62527b727bfa853336d27bd107f1a239228bf1a2.zip
currency: Use proper change colors
-rw-r--r--nodes/currency.lua13
1 files changed, 11 insertions, 2 deletions
diff --git a/nodes/currency.lua b/nodes/currency.lua
index 081f7a3..e9b4167 100644
--- a/nodes/currency.lua
+++ b/nodes/currency.lua
@@ -26,9 +26,18 @@ function node:render()
love.graphics.printf("BTCPLN", 0, 180, love.graphics.getWidth()/2, 'right')
love.graphics.printf("TRYIDR", 0, 350, love.graphics.getWidth()/2, 'right')
love.graphics.setFont(textFont)
-
- love.graphics.setColor( 0, 255, 0 )
+ if self.state.changes[1] then
+ love.graphics.setColor( 0, 255, 0 )
+ else
+ love.graphics.setColor( 255, 0, 0 )
+ end
love.graphics.printf(self.state.values[1], love.graphics.getWidth()/2 + 2*pad, 180, love.graphics.getWidth()/2 - 2*pad, 'left')
+
+ if self.state.changes[2] then
+ love.graphics.setColor( 0, 255, 0 )
+ else
+ love.graphics.setColor( 255, 0, 0 )
+ end
love.graphics.printf(self.state.values[2], love.graphics.getWidth()/2 + 2*pad, 350, love.graphics.getWidth()/2 - 2*pad, 'left')
else
love.graphics.setColor( 255, 255, 255, 80 )