gnysek
Member
Currently, if you want to get instance variable, you use:
id.property
But if you want to get asset property, like sprite width, you need to write sprite_get_width(sprite_name)
I don't see, why GM:S shouldn't allow as alternate (still keeping old way):
sprite_name.width
sprite_name.height
sprite_name.name
sprite_name.number
sprite_name.xoffset
sprite_name.yoffset
sprite_name.bbox_bottom
sprite_name.bbox_left
sprite_name.bbox_right
sprite_name.bbox_top
sprite_name.tpe
sprite_name.texture
sprite_name.uvs
And change above code to sprite_get_xxx() function on compile name (of course as long, as sprite_name is valid resource name and have property after dot)
I propose same for other resources, with properties they can have.
The only problem here are objects, cause for now, you can get variables from existing instance (usually from the one created as first in current room) using object_name.property (like object_name.solid), so there can be different syntax for what I'm proposing:
@resource_name.proprety
~resource_name.property
resource_name->property
...
Anybody interested, or you don't like the idea?
id.property
But if you want to get asset property, like sprite width, you need to write sprite_get_width(sprite_name)
I don't see, why GM:S shouldn't allow as alternate (still keeping old way):
sprite_name.width
sprite_name.height
sprite_name.name
sprite_name.number
sprite_name.xoffset
sprite_name.yoffset
sprite_name.bbox_bottom
sprite_name.bbox_left
sprite_name.bbox_right
sprite_name.bbox_top
sprite_name.tpe
sprite_name.texture
sprite_name.uvs
And change above code to sprite_get_xxx() function on compile name (of course as long, as sprite_name is valid resource name and have property after dot)
I propose same for other resources, with properties they can have.
The only problem here are objects, cause for now, you can get variables from existing instance (usually from the one created as first in current room) using object_name.property (like object_name.solid), so there can be different syntax for what I'm proposing:
@resource_name.proprety
~resource_name.property
resource_name->property
...
Anybody interested, or you don't like the idea?