Merge branch 'opacity_color_bindings' into 'master'

Bindings for image color and widget alpha (#6654)

Closes #6654

See merge request OpenMW/openmw!1723
pull/3226/head
psi29a 3 years ago
commit d2f2393de8

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

@ -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()

@ -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.

@ -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

Loading…
Cancel
Save