SImage¶
Property | Type | Note |
---|---|---|
Aka | String | Name for the widget |
ColorAndOpacity | Number Array, Length = 4 | Linear color values, for example:[0.5, 0.5, 0.5, 1] |
DesiredSizeOverride | Number Array, Length = 2 | For example:[64, 64] |
Image | Object | For example:"Image": |
ImagePath | String | A relative path to current json file, or a absolute path. |
ImagePathInPlugin | String | Resources/Icon128.png |
OnMouseButtonDown | String | The python code which will be executed.. |
OnMouseEnter | String | The python code which will be executed when mouse enter the widget, replacement flag: %uv or %mouse_flags. 1:LMB, 2:MMB, 4:RMB |
OnMouseLeave | String | The python code which will be executed when mouse exit the widget, replacement flag: %mouse_flags. 1:LMB, 2:MMB, 4:RMB |
OnMouseMove | String | The python code which will be executed when mouse move above the widget, replacement flag: %uv or %mouse_flags. 1:LMB, 2:MMB, 4:RMB |
ToolTipText | String | |
Visibility | Enum: EVisibility: Visible, Collapsed, Hidden, HitTestInvisible, SelfHitTestInvisible, All |
functions what can be called from ChameleonData¶
FunctionName | Description | |
---|---|---|
set_image_data | Set SImage's Image content with Raw data.(R, G, B, A:uint8) | |
set_image_pixels | Set SImage's Image content with Linear Colors. | |
set_image_from_path | Set SImage's Image content from local path the resource folder of this plug-in. | |
set_image_from | Set SImage's Image content from local path the resource folder of this plug-in. |
Examples¶
Example 1:
"SImage": {
"Aka": "SImage_A",
"ImagePathInPlugin": "Resources/Icon128.png"
}
Example 2:
"SImage": {
"Aka": "SImage_B",
"ColorAndOpacity": [1, 1, 1, 1],
"ImagePath": "../ChameleonGallery/Images/cartoon_game_map.png",
"ToolTipText": "'ImagePath' is a relative path with the local ui json file.",
"DesiredSizeOverride": [128, 128],
"OnMouseButtonDown": "print('clicked')"
}