Система Flash UI/Элементы UI как динамические текстуры

Материал из CryWiki Russia

(Различия между версиями)
Перейти к: навигация, поиск
DCamer (Обсуждение | вклад)
(Новая страница: «It is possible to Display any '''UIElement''' as a dynamic texture on objects. To do so you have to create a new material and setup the '''DiffuseTexture''' with the...»)
Следующая правка →

Версия 14:13, 9 марта 2012

It is possible to Display any UIElement as a dynamic texture on objects. To do so you have to create a new material and setup the DiffuseTexture with the Name of the UIElement and assign this material to your object.

As DiffuseTexture name simply use the name of the element plus the .ui extension. You also have to change the TexType to “Auto 2D-Map”.

E.g. to Display the USMPlayer (defined in Libs/UI/UIElements/USMPlayer.xml) use USMPlayer.ui. You can also specify an InstanceID by using UIElementName@InstanceID.ui (e.g. USMPlayer@1.ui).

http://freesdk.crydev.net/download/attachments/131618/MaterialSetup.jpg?version=1&modificationDate=1330024849000

Now you can use e.g. a proximity trigger to start the video playback on this object.

http://freesdk.crydev.net/download/attachments/131618/TriggerFG.jpg?version=1&modificationDate=1330024850000

If you enter the trigger, the Video is displayed on the Object.

http://freesdk.crydev.net/download/attachments/131618/Video.jpg?version=1&modificationDate=1330024850000

Interaction on Dynamic Textures

Since the assigned UIElement can be used in any UIAction, you can setup the interactive Flash like any other UIElement.

CryPAD Example

First setup the material:

http://freesdk.crydev.net/download/attachments/131618/CryPAD_MtlSetup.jpg?version=1&modificationDate=1330024851000

Create a simple UIAction flowgraph:

http://freesdk.crydev.net/download/attachments/131618/CryPAD_UIAction.jpg?version=1&modificationDate=1330024852000

By pressing TAB-Key all inputs are locked, and input events are sent to the UIElement.

http://freesdk.crydev.net/download/attachments/131618/CryPAD_Ingame1.jpg?version=1&modificationDate=1330024852000 http://freesdk.crydev.net/download/attachments/131618/CryPAD_Ingame2.jpg?version=1&modificationDate=1330024853000