mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2026-01-27 09:25:57 +00:00
slider fix
This commit is contained in:
parent
45b11aa19b
commit
ceb641ddd9
1 changed files with 10 additions and 0 deletions
|
|
@ -1,5 +1,6 @@
|
|||
package gui;
|
||||
|
||||
import h2d.Scene;
|
||||
import hxd.snd.Channel;
|
||||
import hxd.res.Sound;
|
||||
import hxd.Key;
|
||||
|
|
@ -33,4 +34,13 @@ class GuiSlider extends GuiImage {
|
|||
this.bmp.width = this.bmp.tile.width * Settings.uiScale;
|
||||
super.update(dt, mouseState);
|
||||
}
|
||||
|
||||
public override function render(scene2d:Scene) {
|
||||
super.render(scene2d);
|
||||
var renderRect = getRenderRectangle();
|
||||
this.bmp.width = this.bmp.tile.width * Settings.uiScale;
|
||||
this.bmp.x = renderRect.position.x + renderRect.extent.x * sliderValue;
|
||||
this.bmp.x = Util.clamp(this.bmp.x, renderRect.position.x, renderRect.position.x + renderRect.extent.x - bmp.width / 2);
|
||||
this.bmp.width = this.bmp.tile.width * Settings.uiScale;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue