Advertisement

Handles

Started by November 05, 2024 05:03 PM
13 comments, last by 1vanK 10 minutes ago

1vanK said:
Why it's need to write @obj = @obj2 in AS if user almost always want to copy a reference?

Just a minor observation. You don't need to use @ on both sides. Just on the left is enough to indicate that it is a handle assignment, i.e. @obj = obj2;

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Deleted

Advertisement

Some problem with asEP_DISALLOW_VALUE_ASSIGN_FOR_REF_TYPE and 2d arrays:

Original sprite atlas: https://github.com/dviglo2d/sprite_manipulator/blob/main/res/src_atlas.png

After commit https://github.com/dviglo2d/sprite_manipulator/commit/f58b1db2c91f98174da4531bf8fce9e117f4e4f4 code

Image@[]@[]@ tiles = split(src_atlas, src_tile_size);
tiles[0][0].save_png(base_path + "tile_0_0.png");

saves white square (with real indices [1][0]) instead green

Joined tiles https://github.com/dviglo2d/sprite_manipulator/blob/dissalow/res/exp_atlas.png

instead https://github.com/dviglo2d/sprite_manipulator/blob/main/res/exp_atlas.png

Script before commit: https://github.com/dviglo2d/sprite_manipulator/blob/main/res/main.as

After: https://github.com/dviglo2d/sprite_manipulator/blob/dissalow/res/main.as

daScript have := operator for clone object https://daslang.io/doc/reference/language/clone.html

Advertisement