- [Transform] Fix position value blow up when animating.

This commit is contained in:
Tanasart 2023-09-21 12:05:06 +02:00
parent 68f19cd5d5
commit 8a811a84a5
8 changed files with 22 additions and 25 deletions

View file

@ -1,6 +1,7 @@
/// @description
gameframe_init();
gameframe_button_array = [];
#region setup
window_set_size(640, 480);
display_set_gui_size(640, 480);
@ -8,7 +9,7 @@ gameframe_button_array = [];
window_set_caption("Pixel Composer crashed")
window_set_position(
(display_get_width() - 640) / 2,
(display_get_height() - 320) / 2); // center window
(display_get_height() - 480) / 2); // center window
#endregion
#region directory
@ -51,5 +52,5 @@ gameframe_button_array = [];
}
win_w = 640;
win_h = 320;
win_h = 480;
#endregion

View file

@ -2,8 +2,8 @@
gameframe_update();
draw_clear(#1c1c23);
var w = window_get_width();
var h = window_get_height();
var w = 640;
var h = 480;
if(win_w != w || win_h != h) {
display_set_gui_size(w, h);
@ -31,9 +31,9 @@ draw_sprite_ext(s_noti_icon_error, 0, 18, 18, 0.5, 0.5, 0, c_white, 1);
var y0 = 32;
var x1 = w - 8;
var y1 = h - 8 - 32 - 8;
var tw = x1 - x0;
var th = y1 - y0;
var tw = max(1, x1 - x0);
var th = max(1, y1 - y0);
draw_sprite_stretched(s_textbox, 3, x0, y0, tw, th);
draw_sprite_stretched(s_textbox, 0, x0, y0, tw, th);

View file

@ -3,8 +3,8 @@
global.PROC_ID = bool(EnvironmentGetVariableExists("process_id"))? int64(EnvironmentGetVariable("process_id")) : 0;
EnvironmentSetVariable("process_id", string(global.PROC_ID + 1));
if (global.PROC_ID == 1) { // if spawn after the main windows
instance_destroy(o_main, false);
if (global.PROC_ID == 0)
instance_create(0, 0, o_main);
else if (global.PROC_ID == 1)
instance_create(0, 0, o_crash_handler);
}
#endregion

View file

@ -8,12 +8,10 @@
"inheritLayers": false,
"instanceCreationOrder": [
{"name":"inst_5CA22FC1","path":"rooms/rm_main/rm_main.yy",},
{"name":"inst_78CD7A2C","path":"rooms/rm_main/rm_main.yy",},
],
"isDnd": false,
"layers": [
{"resourceType":"GMRInstanceLayer","resourceVersion":"1.0","name":"Instances","depth":0,"effectEnabled":true,"effectType":null,"gridX":16,"gridY":16,"hierarchyFrozen":false,"inheritLayerDepth":false,"inheritLayerSettings":false,"inheritSubLayers":true,"inheritVisibility":true,"instances":[
{"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_78CD7A2C","colour":4294967295,"frozen":false,"hasCreationCode":false,"ignore":false,"imageIndex":0,"imageSpeed":1.0,"inheritCode":false,"inheritedItemId":null,"inheritItemSettings":false,"isDnd":false,"objectId":{"name":"o_main","path":"objects/o_main/o_main.yy",},"properties":[],"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"x":160.0,"y":160.0,},
{"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_5CA22FC1","colour":4294967295,"frozen":false,"hasCreationCode":false,"ignore":false,"imageIndex":0,"imageSpeed":1.0,"inheritCode":false,"inheritedItemId":null,"inheritItemSettings":false,"isDnd":false,"objectId":{"name":"o_process_handler","path":"objects/o_process_handler/o_process_handler.yy",},"properties":[],"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"x":160.0,"y":96.0,},
],"layers":[],"properties":[],"userdefinedDepth":false,"visible":true,},
{"resourceType":"GMRBackgroundLayer","resourceVersion":"1.0","name":"Background","animationFPS":15.0,"animationSpeedType":0,"colour":4280491036,"depth":100,"effectEnabled":true,"effectType":null,"gridX":16,"gridY":16,"hierarchyFrozen":false,"hspeed":0.0,"htiled":false,"inheritLayerDepth":false,"inheritLayerSettings":false,"inheritSubLayers":true,"inheritVisibility":true,"layers":[],"properties":[],"spriteId":null,"stretch":false,"userdefinedAnimFPS":false,"userdefinedDepth":false,"visible":true,"vspeed":0.0,"vtiled":false,"x":0,"y":0,},

View file

@ -107,10 +107,10 @@
globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER;
VERSION = 11521;
VERSION = 11522;
SAVE_VERSION = 11500;
VERSION_STRING = "1.15.2.1";
BUILD_NUMBER = 11521;
VERSION_STRING = "1.15.2.2";
BUILD_NUMBER = 11522;
globalvar APPEND_MAP;
APPEND_MAP = ds_map_create();

View file

@ -171,15 +171,11 @@ function valueAnimator(_val, _prop, _sep_axis = false) constructor {
return false;
}
if(ds_list_size(values) == 0)
return processTypeDefault();
if(ds_list_size(values) == 1)
return processType(values[| 0].value);
if(ds_list_size(values) == 0) return processTypeDefault();
if(ds_list_size(values) == 1) return processType(values[| 0].value);
if(prop.type == VALUE_TYPE.path)
return processType(values[| 0].value);
if(!prop.is_anim)
return processType(values[| 0].value);

View file

@ -58,7 +58,7 @@ function Node_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
attribute_interpolation();
vel = 0;
prev_pos = [0, 0];
prev_pos = [ 0, 0 ];
static getDimension = function(arr) { #region
var _surf = getSingleValue(0, arr);
@ -474,7 +474,9 @@ function Node_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
draw_set_color(COLORS._main_accent);
for( var i = 0; i < ds_list_size(allPos); i++ ) {
var _pos = allPos[| i].value;
var pos = allPos[| i].value;
var _pos = [ pos[0], pos[1] ];
if(posInp.unit.mode == VALUE_UNIT.reference) {
_pos[0] *= ow;
_pos[1] *= oh;

View file

@ -1220,7 +1220,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
if(cache_hit) {
global.cache_hit++;
return cache_value[2];
return array_clone(cache_value[2]);
}
}
@ -1232,7 +1232,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
cache_value[1] = _time;
}
cache_value[2] = val;
cache_value[2] = array_clone(val);
cache_value[3] = applyUnit;
return val;