mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-26 23:17:25 +01:00
19 lines
No EOL
550 B
Text
19 lines
No EOL
550 B
Text
function draw_surface_align(surface, _x, _y, _s, _halign = fa_left, _valign = fa_top) {
|
|
var w = surface_get_width(surface) * _s;
|
|
var h = surface_get_height(surface) * _s;
|
|
|
|
var _sx = _x, _sy = _y;
|
|
switch(_halign) {
|
|
case fa_left: _sx = _x; break;
|
|
case fa_center: _sx = _x - w / 2; break;
|
|
case fa_right: _sx = _x - w; break;
|
|
}
|
|
|
|
switch(_valign) {
|
|
case fa_top: _sy = _y; break;
|
|
case fa_center: _sy = _y - h / 2; break;
|
|
case fa_bottom: _sy = _y - h; break;
|
|
}
|
|
|
|
draw_surface_ext(surface, _sx, _sy, _s, _s, 0, c_white, 1);
|
|
} |