ID:92716
 
Redundant
Applies to:Dream Maker
Status: Redundant

This feature has already been implemented, or is already achievable with existing methods.
I was thinking of an easy way to set the size of an icon which is displayed via the \icon text macro.

Perhaps an optional suffix to the macro. Example:

world << "Smiley face BIG: \icon[smiley.dmi]("64x64")"
world << "Smiley face BIG: \icon[smiley.dmi](64)"

2 ways to display a 64x64 icon in the default output.

world << "Smiley face BIG: \icon[smiley.dmi]("32x64")"

Displays a 32x64 icon in the default output.
After messing around with this it does seem to be impossible to do it effectively or dynamically.
Some new additions to the IMG tag should be enough though.
You can set up CSS rules (either for the output itself or in a .dms) that apply to certain tags to give the img tag whatever size is appropriate. If you want to manually set the size on a per-icon basis, you can modify the img tag directly. There are examples of using CSS in this way in the reference. In addition I believe you can also set width and height to auto to use the intrinsic size of the icon, though I haven't tested that to be certain.
You can't modify client.script (which is where you set the CSS tags as far as I could tell) at runtime, and I attempted to set various things in the IMG tag, none of which seemed to work.
The img tag should support width and height attributes, but if you set the width and height via a style attribute that would definitely work.
Lummox JR wrote:
The img tag should support width and height attributes

It doesn't

but if you set the width and height via a style attribute that would definitely work.

Not editable at runtime though?
You can add a style attribute to any tag; this has nothing to do with client.script. If you want a more general CSS change you can also change an output control's CSS at runtime.
I'm still not having any luck getting any type of tags to work for this. But changing the style on the interface control works well enough.
A style attribute will most definitely work, since the tag responds to those attributes in CSS:

<img src=... style="width:32px; height:64px">


Getting separate width and height attributes to work would be a good item for the feature list as well, but with the style attribute you can set width and height manually for any image.