1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-21 09:39:56 +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;
setImageCoord(atlasCoord);
setColour(propertyValue("color", MyGUI::Colour(1,1,1,1)));
WidgetExtension::updateProperties();
}
}

View File

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

View File

@ -20,3 +20,6 @@ Properties
* - tileV
- boolean (false)
- 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
- boolean (true)
- 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