1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-03 15:09:39 +00:00

mygui bindings for color and alpha

This commit is contained in:
glassmancody.info 2022-03-21 22:00:32 -07:00
parent eb46bde75e
commit 26c7e308ed
4 changed files with 15 additions and 0 deletions

View file

@ -68,6 +68,8 @@ namespace LuaUi
atlasCoord.height = textureSize.height; atlasCoord.height = textureSize.height;
setImageCoord(atlasCoord); setImageCoord(atlasCoord);
setColour(propertyValue("color", MyGUI::Colour(1,1,1,1)));
WidgetExtension::updateProperties(); WidgetExtension::updateProperties();
} }
} }

View file

@ -259,6 +259,8 @@ namespace LuaUi
mAnchor = propertyValue("anchor", MyGUI::FloatSize()); mAnchor = propertyValue("anchor", MyGUI::FloatSize());
mWidget->setVisible(propertyValue("visible", true)); mWidget->setVisible(propertyValue("visible", true));
mWidget->setPointer(propertyValue("pointer", std::string("arrow"))); mWidget->setPointer(propertyValue("pointer", std::string("arrow")));
mWidget->setAlpha(propertyValue("alpha", 1.f));
mWidget->setInheritsAlpha(propertyValue("inheritAlpha", true));
} }
void WidgetExtension::updateChildrenCoord() void WidgetExtension::updateChildrenCoord()

View file

@ -20,3 +20,6 @@ Properties
* - tileV * - tileV
- boolean (false) - boolean (false)
- Tile the texture vertically - Tile the texture vertically
* - color
- util.color (1, 1, 1)
- Modulate constant color with the color of the image texture.

View file

@ -35,6 +35,14 @@ Properties
* - propagateEvents * - propagateEvents
- boolean (true) - boolean (true)
- Allows base widget events to propagate to the widget's parent. - Allows base widget events to propagate to the widget's parent.
* - alpha
- number (1.0)
- | Set the opacity of the widget and its contents.
| If `inheritAlpha` is set to `true`, this becomes the maximum alpha value the widget can take.
* - inheritAlpha
- boolean (true)
- | Modulate `alpha` with parents `alpha`.
| If the parent has `inheritAlpha` set to `true`, the value after modulating is passed to the child.
.. TODO: document the mouse pointer property, when API for reading / adding pointer types is available .. TODO: document the mouse pointer property, when API for reading / adding pointer types is available