diff options
author | Aki <nthirtyone@gmail.com> | 2017-09-05 19:13:45 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2017-09-05 19:13:45 +0200 |
commit | de86586e3957be9e0794698e86ce913adc91beea (patch) | |
tree | 9e107cdca02714545a977f9dbfc074313d7d4458 /not/Decoration.lua | |
parent | 1ffc08dd2343b76b2f94d9c290ef346346585270 (diff) | |
download | roflnauts-de86586e3957be9e0794698e86ce913adc91beea.zip roflnauts-de86586e3957be9e0794698e86ce913adc91beea.tar.gz roflnauts-de86586e3957be9e0794698e86ce913adc91beea.tar.bz2 |
That background kept irritating me. Background now follows offset with ratio
Diffstat (limited to 'not/Decoration.lua')
-rw-r--r-- | not/Decoration.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/not/Decoration.lua b/not/Decoration.lua index 97524f5..6068a61 100644 --- a/not/Decoration.lua +++ b/not/Decoration.lua @@ -21,4 +21,13 @@ function Decoration:setPosition (x, y) self.x, self.y = x, y end +-- TODO: Temporary wrapper for draw to keep background in place. +function Decoration:draw (offset_x, offset_y, scale) + if self.ratio ~= nil then + offset_x = offset_x * self.ratio + offset_y = offset_y * self.ratio + end + Decoration.__super.draw(self, offset_x, offset_y, scale) +end + return Decoration |