Is there any plan to further develop this? I've finally gotten around to implementing autoUI into my project, and the proposed solution only partially works. Specifically, it has issues with reducing the sprite size (your proposed solution works for increasing sprite sizes). I can work around this by add_space-ing a negative value, but a strange vertical offset occurs within a container_h (which itself is contained in a container_v). I'm trying to find a workaround currently, but haven't had much luck so far.
If you enable the set_scale code in the AutoUiImage script, does that do what you're asking for? I've done some minimal testing and it does work that way, but I'm unsure specifically what issue you're running into. You can also copy your code here and I can maybe help point you in the right direction.
set_scale partially works, but seems to only scale the X dimension (while padding elements as if they were unscaled) for my container_h. These are vector images, if that matters.
I'll include my code, but as a warning it's very split up. I'll try and copy all the relevant snippets.
Both attempts (using a manual workaround and using set_scale) are included here. The only difference (aside from the two sections in the first block) is the last line of the first block, which calls uiContainerToElement instead of uiContainerImagesToElements when using set_scale.
for (var i = 0; i < ds_list_size(_unit.actions); i++){
var _action = ds_list_find_value(_unit.actions, i);
var _sprite = _action.iconSprite;
var _element = auto_image(_sprite);
//SET_SCALE IMPLEMENTATION
_element.set_scale(0.1);
actionsSubContainer.add(_element);
//MANUAL WORKAROUND IMPLEMENTATION
/**
_element.set_visible(false);
_element.staticScale = 0.1; //Easiest to toss a new field into the struct for reference later
actionsSubContainer.add(_element);
actionsSubContainer.add_space(-sprite_get_width(_sprite)*0.9);
array_push(_actionImagesArray, _element);
**/
}
actionsSubContainer.step(600*global.uiScale, (_yBase + 50) * global.uiScale);
uiElements = array_concat(uiElements, uiContainerImagesToElements(actionsSubContainer, _actionImagesArray));
function uiContainerImagesToElements(_container, _images){
var _array = [uiContainerToElement(_container)];
for (var i = 0; i < array_length(_images); i++){
var _subElement = createEmptyUIElement();
var _imageElement = _images[i];
_subElement.drawFunction = method({_imageElement}, function(_element){
draw_sprite_ext(_imageElement.get_sprite(), 0, _imageElement.get_bbox_left(), _imageElement.get_bbox_right(), _imageElement.staticScale, _imageElement.staticScale, 0, c_white, 1);
});
array_push(_array, _subElement);
}
return _array;
}
function uiContainerToElement(_container){
var _element = createEmptyUIElement();
_element.drawFunction = method({_container}, function(_element){
_container.draw();
});
return _element;
}
if (true) {
for (var i = 0; i < array_length(uiElements); i++){
uiArray[i].drawFunction(uiElements[i]);
}
}