KubeJS

KubeJS

61M Downloads

Scale from side Painter rectangle option.

briarss opened this issue ยท 1 comments

commented

Describe the feature

Painter rectangles are scaled from the center, which is fair enough, but a scaling option to start from a side would be very nice for anyone trying to create "bars" such as energy meters or whatnot. Something like;

event.player.paint({
            barPaint: {
                type: 'text',
                x: 0,
                y: 12,
                scale: 0.5,
                alignX: 'center',
                alignY: 'center',
                draw: 'ingame',
                text: `${bar.current}/${bar.cap}`,
                scaleFrom: left
            }
        })

Additional info

No response

commented

Im pretty sure you can use Units for this, something like x: '(($screenW - $w) / 2.0)' or something similar