Tidied up the sample descriptions.
Exposed UIElement::SetVar() and GetVar() to Lua script. Modified the Lua Sprites sample to use custom vars inside UIElement.
This commit is contained in:
Родитель
389cce6732
Коммит
7a55a43725
|
@ -1,8 +1,8 @@
|
|||
-- This first example, maintaining tradition, prints a "Hello World" message.
|
||||
-- Furthermore it shows:
|
||||
-- - Using the Sample utility functions as a base for the application;
|
||||
-- - Adding a Text element to the graphical user interface;
|
||||
-- - Subscribing to and handling of update events;
|
||||
-- - Using the Sample utility functions as a base for the application
|
||||
-- - Adding a Text element to the graphical user interface
|
||||
-- - Subscribing to and handling of update events
|
||||
|
||||
require "LuaScripts/Utilities/Sample"
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
-- A simple 'HelloWorld' GUI created purely from code.
|
||||
-- This sample demonstrates:
|
||||
-- - Creation of controls and building a UI hierarchy;
|
||||
-- - Loading UI style from XML and applying it to controls;
|
||||
-- - Handling of global and per-control events;
|
||||
-- - Creation of controls and building a UI hierarchy
|
||||
-- - Loading UI style from XML and applying it to controls
|
||||
-- - Handling of global and per-control events
|
||||
|
||||
require "LuaScripts/Utilities/Sample"
|
||||
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
-- Moving sprites example.
|
||||
-- This sample demonstrates:
|
||||
-- - Adding Sprite elements to the UI;
|
||||
-- - Storing custom data (sprite velocity) inside UI elements;
|
||||
-- - Handling frame update events in which the sprites are moved;
|
||||
-- - Adding Sprite elements to the UI
|
||||
-- - Storing custom data (sprite velocity) inside UI elements
|
||||
-- - Handling frame update events in which the sprites are moved
|
||||
|
||||
require "LuaScripts/Utilities/Sample"
|
||||
|
||||
local numSprites = 100
|
||||
local sprites = {}
|
||||
local speeds = {}
|
||||
|
||||
-- Custom variable identifier for storing sprite velocity within the UI element
|
||||
local VAR_VELOCITY = ShortStringHash("Velocity")
|
||||
|
||||
local context = GetContext()
|
||||
|
||||
|
@ -35,22 +37,33 @@ function CreateSprites()
|
|||
local height = graphics.height
|
||||
|
||||
for i = 1, numSprites do
|
||||
-- Create a new sprite, set it to use the texture
|
||||
local sprite = Sprite:new(context)
|
||||
sprite.texture = decalTex
|
||||
sprite:SetFullImageRect()
|
||||
sprite:SetFullImageRect()
|
||||
|
||||
-- The UI root element is as big as the rendering window, set random position within it
|
||||
sprite.position = Vector2(Random(width), Random(height))
|
||||
|
||||
-- Set sprite size & hotspot in its center
|
||||
sprite:SetSize(128, 128)
|
||||
sprite.hotSpot = IntVector2(64, 64)
|
||||
sprite.rotation = Random(360)
|
||||
sprite.scale = Vector2(1, 1) * (Random(1) + 0.5)
|
||||
|
||||
-- Set random rotation in degrees and random scale
|
||||
sprite.rotation = Random(360.0)
|
||||
sprite.scale = Vector2(1.0, 1.0) * (Random(1.0) + 0.5)
|
||||
|
||||
-- Set random color and additive blending mode
|
||||
sprite:SetColor(Color(Random(0.5) + 0.5, Random(0.5) + 0.5, Random(0.5) + 0.5, 1.0))
|
||||
sprite.blendMode = BLEND_ADD
|
||||
|
||||
|
||||
-- Add as a child of the root UI element
|
||||
ui.root:AddChild(sprite)
|
||||
|
||||
-- Store sprite's velocity as a custom variable
|
||||
sprite:SetVar(VAR_VELOCITY, Variant(Vector2(Random(200.0) - 100.0, Random(200.0) - 100.0)))
|
||||
|
||||
table.insert(sprites, sprite)
|
||||
table.insert(speeds, Vector2(Random(200) - 100, Random(200) - 100))
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -68,7 +81,7 @@ function MoveSprites(timeStep)
|
|||
sprite.rotation = sprite.rotation + timeStep * 30
|
||||
|
||||
local newPos = sprite.position
|
||||
newPos = newPos + speeds[i] * timeStep
|
||||
newPos = newPos + sprite:GetVar(VAR_VELOCITY):GetVector2() * timeStep
|
||||
|
||||
if newPos.x >= width then
|
||||
newPos.x = newPos.x - width
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
-- Static 3D scene example.
|
||||
-- This sample demonstrates:
|
||||
-- - Creating a 3D scene with static content;
|
||||
-- - Displaying the scene using the Renderer subsystem;
|
||||
-- - Handling keyboard and mouse input to move a freelook camera;
|
||||
-- - Creating a 3D scene with static content
|
||||
-- - Displaying the scene using the Renderer subsystem
|
||||
-- - Handling keyboard and mouse input to move a freelook camera
|
||||
|
||||
require "LuaScripts/Utilities/Sample"
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
-- Animating 3D scene example.
|
||||
-- This sample demonstrates:
|
||||
-- - Creating a 3D scene and using a script component to animate the objects;
|
||||
-- - Controlling scene ambience with the Zone component;
|
||||
-- - Attaching a light to an object (the camera);
|
||||
-- - Creating a 3D scene and using a script component to animate the objects
|
||||
-- - Controlling scene ambience with the Zone component
|
||||
-- - Attaching a light to an object (the camera)
|
||||
|
||||
require "LuaScripts/Utilities/Sample"
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
-- Skeletal animation example.
|
||||
-- This sample demonstrates:
|
||||
-- - Populating a 3D scene with skeletally animated AnimatedModel components;
|
||||
-- - Moving the animated models and advancing their animation using a script object;
|
||||
-- - Enabling a cascaded shadow map on a directional light, which allows high-quality shadows;
|
||||
-- over a large area (typically used in outdoor scenes for shadows cast by sunlight);
|
||||
-- - Displaying renderer debug geometry;
|
||||
-- - Populating a 3D scene with skeletally animated AnimatedModel components
|
||||
-- - Moving the animated models and advancing their animation using a script object
|
||||
-- - Enabling a cascaded shadow map on a directional light, which allows high-quality shadows
|
||||
-- over a large area (typically used in outdoor scenes for shadows cast by sunlight)
|
||||
-- - Displaying renderer debug geometry
|
||||
|
||||
require "LuaScripts/Utilities/Sample"
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
-- Billboard example.
|
||||
-- This sample demonstrates:
|
||||
-- - Populating a 3D scene with billboard sets and several shadow casting spotlights;
|
||||
-- - Parenting scene nodes to allow more intuitive creation of groups of objects;
|
||||
-- - Examining rendering performance with a somewhat large object and light count;
|
||||
-- - Populating a 3D scene with billboard sets and several shadow casting spotlights
|
||||
-- - Parenting scene nodes to allow more intuitive creation of groups of objects
|
||||
-- - Examining rendering performance with a somewhat large object and light count
|
||||
|
||||
require "LuaScripts/Utilities/Sample"
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
-- Decals example.
|
||||
-- This sample demonstrates:
|
||||
-- - Performing a raycast to the octree and adding a decal to the hit location;
|
||||
-- - Defining a Cursor UI element which stays inside the window and can be shown/hidden;
|
||||
-- - Marking suitable (large) objects as occluders for occlusion culling;
|
||||
-- - Displaying renderer debug geometry to see the effect of occlusion;
|
||||
-- - Performing a raycast to the octree and adding a decal to the hit location
|
||||
-- - Defining a Cursor UI element which stays inside the window and can be shown/hidden
|
||||
-- - Marking suitable (large) objects as occluders for occlusion culling
|
||||
-- - Displaying renderer debug geometry to see the effect of occlusion
|
||||
|
||||
require "LuaScripts/Utilities/Sample"
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
-- Multiple viewports example.
|
||||
-- This sample demonstrates:
|
||||
-- - Setting up two viewports with two separate cameras;
|
||||
-- - Adding post processing effects to a viewport's render path and toggling them;
|
||||
-- - Setting up two viewports with two separate cameras
|
||||
-- - Adding post processing effects to a viewport's render path and toggling them
|
||||
|
||||
require "LuaScripts/Utilities/Sample"
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
-- Physics stress test example.
|
||||
-- This sample demonstrates:
|
||||
-- - Physics and rendering performance with a high (1000) moving object count;
|
||||
-- - Using triangle meshes for collision;
|
||||
-- - Optimizing physics simulation by leaving out collision event signaling;
|
||||
-- - Physics and rendering performance with a high (1000) moving object count
|
||||
-- - Using triangle meshes for collision
|
||||
-- - Optimizing physics simulation by leaving out collision event signaling
|
||||
|
||||
require "LuaScripts/Utilities/Sample"
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
-- Sound effects example
|
||||
-- This sample demonstrates:
|
||||
-- - Playing sound effects and music;
|
||||
-- - Controlling sound and music master volume;
|
||||
-- - Playing sound effects and music
|
||||
-- - Controlling sound and music master volume
|
||||
|
||||
require "LuaScripts/Utilities/Sample"
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
-- Vehicle example.
|
||||
-- This sample demonstrates:
|
||||
-- - Creating a heightmap terrain with collision;
|
||||
-- - Constructing a physical vehicle with rigid bodies for the hull and the wheels, joined with constraints;
|
||||
-- - Creating a heightmap terrain with collision
|
||||
-- - Constructing a physical vehicle with rigid bodies for the hull and the wheels, joined with constraints
|
||||
|
||||
require "LuaScripts/Utilities/Sample"
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
-- Huge object count example.
|
||||
-- This sample demonstrates:
|
||||
-- - Creating a scene with 250 x 250 simple objects;
|
||||
-- - Competing with http://yosoygames.com.ar/wp/2013/07/ogre-2-0-is-up-to-3x-faster/ :);
|
||||
-- - Allowing examination of performance hotspots in the rendering code;
|
||||
-- - Optionally speeding up rendering by grouping the objects using StaticModelGroup component;
|
||||
-- - Creating a scene with 250 x 250 simple objects
|
||||
-- - Competing with http://yosoygames.com.ar/wp/2013/07/ogre-2-0-is-up-to-3x-faster/ :)
|
||||
-- - Allowing examination of performance hotspots in the rendering code
|
||||
-- - Optionally speeding up rendering by grouping objects with the StaticModelGroup component
|
||||
|
||||
require "LuaScripts/Utilities/Sample"
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
// This first example, maintaining tradition, prints a "Hello World" message.
|
||||
// Furthermore it shows:
|
||||
// - Using the Sample utility functions as a base for the application;
|
||||
// - Adding a Text element to the graphical user interface;
|
||||
// - Subscribing to and handling of update events;
|
||||
// - Using the Sample utility functions as a base for the application
|
||||
// - Adding a Text element to the graphical user interface
|
||||
// - Subscribing to and handling of update events
|
||||
|
||||
#include "Scripts/Utilities/Sample.as"
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
// A simple 'HelloWorld' GUI created purely from code.
|
||||
// This sample demonstrates:
|
||||
// - Creation of controls and building a UI hierarchy;
|
||||
// - Loading UI style from XML and applying it to controls;
|
||||
// - Handling of global and per-control events;
|
||||
// - Creation of controls and building a UI hierarchy
|
||||
// - Loading UI style from XML and applying it to controls
|
||||
// - Handling of global and per-control events
|
||||
|
||||
#include "Scripts/Utilities/Sample.as"
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
// Moving sprites example.
|
||||
// This sample demonstrates:
|
||||
// - Adding Sprite elements to the UI;
|
||||
// - Storing custom data (sprite velocity) inside UI elements;
|
||||
// - Handling frame update events in which the sprites are moved;
|
||||
// - Adding Sprite elements to the UI
|
||||
// - Storing custom data (sprite velocity) inside UI elements
|
||||
// - Handling frame update events in which the sprites are moved
|
||||
|
||||
#include "Scripts/Utilities/Sample.as"
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
// Static 3D scene example.
|
||||
// This sample demonstrates:
|
||||
// - Creating a 3D scene with static content;
|
||||
// - Displaying the scene using the Renderer subsystem;
|
||||
// - Handling keyboard and mouse input to move a freelook camera;
|
||||
// - Creating a 3D scene with static content
|
||||
// - Displaying the scene using the Renderer subsystem
|
||||
// - Handling keyboard and mouse input to move a freelook camera
|
||||
|
||||
#include "Scripts/Utilities/Sample.as"
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
// Animating 3D scene example.
|
||||
// This sample demonstrates:
|
||||
// - Creating a 3D scene and using a script component to animate the objects;
|
||||
// - Controlling scene ambience with the Zone component;
|
||||
// - Attaching a light to an object (the camera);
|
||||
// - Creating a 3D scene and using a script component to animate the objects
|
||||
// - Controlling scene ambience with the Zone component
|
||||
// - Attaching a light to an object (the camera)
|
||||
|
||||
#include "Scripts/Utilities/Sample.as"
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
// Skeletal animation example.
|
||||
// This sample demonstrates:
|
||||
// - Populating a 3D scene with skeletally animated AnimatedModel components;
|
||||
// - Moving the animated models and advancing their animation using a script object;
|
||||
// - Populating a 3D scene with skeletally animated AnimatedModel components
|
||||
// - Moving the animated models and advancing their animation using a script object
|
||||
// - Enabling a cascaded shadow map on a directional light, which allows high-quality shadows
|
||||
// over a large area (typically used in outdoor scenes for shadows cast by sunlight);
|
||||
// - Displaying renderer debug geometry;
|
||||
// over a large area (typically used in outdoor scenes for shadows cast by sunlight)
|
||||
// - Displaying renderer debug geometry
|
||||
|
||||
#include "Scripts/Utilities/Sample.as"
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
// Billboard example.
|
||||
// This sample demonstrates:
|
||||
// - Populating a 3D scene with billboard sets and several shadow casting spotlights;
|
||||
// - Parenting scene nodes to allow more intuitive creation of groups of objects;
|
||||
// - Examining rendering performance with a somewhat large object and light count;
|
||||
// - Populating a 3D scene with billboard sets and several shadow casting spotlights
|
||||
// - Parenting scene nodes to allow more intuitive creation of groups of objects
|
||||
// - Examining rendering performance with a somewhat large object and light count
|
||||
|
||||
#include "Scripts/Utilities/Sample.as"
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
// Decals example.
|
||||
// This sample demonstrates:
|
||||
// - Performing a raycast to the octree and adding a decal to the hit location;
|
||||
// - Defining a Cursor UI element which stays inside the window and can be shown/hidden;
|
||||
// - Marking suitable (large) objects as occluders for occlusion culling;
|
||||
// - Displaying renderer debug geometry to see the effect of occlusion;
|
||||
// - Performing a raycast to the octree and adding a decal to the hit location
|
||||
// - Defining a Cursor UI element which stays inside the window and can be shown/hidden
|
||||
// - Marking suitable (large) objects as occluders for occlusion culling
|
||||
// - Displaying renderer debug geometry to see the effect of occlusion
|
||||
|
||||
#include "Scripts/Utilities/Sample.as"
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Multiple viewports example.
|
||||
// This sample demonstrates:
|
||||
// - Setting up two viewports with two separate cameras;
|
||||
// - Adding post processing effects to a viewport's render path and toggling them;
|
||||
// - Setting up two viewports with two separate cameras
|
||||
// - Adding post processing effects to a viewport's render path and toggling them
|
||||
|
||||
#include "Scripts/Utilities/Sample.as"
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Render to texture example
|
||||
// This sample demonstrates:
|
||||
// - Creating two 3D scenes and rendering the other into a texture;
|
||||
// - Creating rendertarget textures and materials programmatically;
|
||||
// - Creating two 3D scenes and rendering the other into a texture
|
||||
// - Creating rendertarget texture and material programmatically
|
||||
|
||||
#include "Scripts/Utilities/Sample.as"
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
// Physics example.
|
||||
// This sample demonstrates:
|
||||
// - Creating both static and moving physics objects to a scene;
|
||||
// - Displaying physics debug geometry;
|
||||
// - Using the Skybox component for setting up an unmoving sky;
|
||||
// - Saving a scene to a file and loading it to restore a previous state;
|
||||
// - Creating both static and moving physics objects to a scene
|
||||
// - Displaying physics debug geometry
|
||||
// - Using the Skybox component for setting up an unmoving sky
|
||||
// - Saving a scene to a file and loading it to restore a previous state
|
||||
|
||||
#include "Scripts/Utilities/Sample.as"
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
// Physics stress test example.
|
||||
// This sample demonstrates:
|
||||
// - Physics and rendering performance with a high (1000) moving object count;
|
||||
// - Using triangle meshes for collision;
|
||||
// - Optimizing physics simulation by leaving out collision event signaling;
|
||||
// - Physics and rendering performance with a high (1000) moving object count
|
||||
// - Using triangle meshes for collision
|
||||
// - Optimizing physics simulation by leaving out collision event signaling
|
||||
|
||||
#include "Scripts/Utilities/Sample.as"
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
// Ragdoll example.
|
||||
// This sample demonstrates:
|
||||
// - Detecting physics collisions;
|
||||
// - Moving an AnimatedModel's bones with physics and connecting them with constraints;
|
||||
// - Using rolling friction to stop rolling objects from moving infinitely;
|
||||
// - Detecting physics collisions
|
||||
// - Moving an AnimatedModel's bones with physics and connecting them with constraints
|
||||
// - Using rolling friction to stop rolling objects from moving infinitely
|
||||
|
||||
#include "Scripts/Utilities/Sample.as"
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Sound effects example
|
||||
// This sample demonstrates:
|
||||
// - Playing sound effects and music;
|
||||
// - Controlling sound and music master volume;
|
||||
// - Playing sound effects and music
|
||||
// - Controlling sound and music master volume
|
||||
|
||||
#include "Scripts/Utilities/Sample.as"
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
// Navigation example.
|
||||
// This sample demonstrates:
|
||||
// - Generating a navigation mesh into the scene;
|
||||
// - Performing path queries to the navigation mesh;
|
||||
// - Rebuilding the navigation mesh partially when adding or removing objects;
|
||||
// - Visualizing custom debug geometry;
|
||||
// - Generating a navigation mesh into the scene
|
||||
// - Performing path queries to the navigation mesh
|
||||
// - Rebuilding the navigation mesh partially when adding or removing objects
|
||||
// - Visualizing custom debug geometry
|
||||
|
||||
#include "Scripts/Utilities/Sample.as"
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Chat example
|
||||
// This sample demonstrates:
|
||||
// - Starting up a network server or connecting to it;
|
||||
// - Implementing simple chat functionality with network messages;
|
||||
// - Starting up a network server or connecting to it
|
||||
// - Implementing simple chat functionality with network messages
|
||||
|
||||
#include "Scripts/Utilities/Sample.as"
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
// Scene network replication example.
|
||||
// This sample demonstrates:
|
||||
// - Creating a scene in which network clients can join;
|
||||
// - Creating a scene in which network clients can join
|
||||
// - Giving each client an object to control and sending the controls from the clients to the server,
|
||||
// where the authoritative simulation happens;
|
||||
// - Controlling a physics object's movement by applying forces;
|
||||
// where the authoritative simulation happens
|
||||
// - Controlling a physics object's movement by applying forces
|
||||
|
||||
#include "Scripts/Utilities/Sample.as"
|
||||
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
// Moving character example.
|
||||
// This sample demonstrates:
|
||||
// - Controlling a humanoid character through physics;
|
||||
// - Driving animations using the AnimationController component;
|
||||
// - Implementing 1st and 3rd person cameras, using raycasts to avoid the 3rd person camera
|
||||
// clipping into scenery;
|
||||
// - Saving and loading the variables of a script object;
|
||||
// - Controlling a humanoid character through physics
|
||||
// - Driving animations using the AnimationController component
|
||||
// - Implementing 1st and 3rd person cameras, using raycasts to avoid the 3rd person camera clipping into scenery
|
||||
// - Saving and loading the variables of a script object
|
||||
|
||||
#include "Scripts/Utilities/Sample.as"
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
// Vehicle example.
|
||||
// This sample demonstrates:
|
||||
// - Creating a heightmap terrain with collision;
|
||||
// - Constructing a physical vehicle with rigid bodies for the hull and the wheels, joined with constraints;
|
||||
// - Saving and loading the variables of a script object, including node & component references;
|
||||
// - Creating a heightmap terrain with collision
|
||||
// - Constructing a physical vehicle with rigid bodies for the hull and the wheels, joined with constraints
|
||||
// - Saving and loading the variables of a script object, including node & component references
|
||||
|
||||
#include "Scripts/Utilities/Sample.as"
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
// Huge object count example.
|
||||
// This sample demonstrates:
|
||||
// - Creating a scene with 250 x 250 simple objects;
|
||||
// - Creating a scene with 250 x 250 simple objects
|
||||
// - Competing with http://yosoygames.com.ar/wp/2013/07/ogre-2-0-is-up-to-3x-faster/ :)
|
||||
// - Allowing examination of performance hotspots in the rendering code;
|
||||
// - Optionally speeding up rendering by grouping the objects using StaticModelGroup component;
|
||||
// - Allowing examination of performance hotspots in the rendering code
|
||||
// - Optionally speeding up rendering by grouping objects with the StaticModelGroup component
|
||||
|
||||
#include "Scripts/Utilities/Sample.as"
|
||||
|
||||
|
|
|
@ -4528,6 +4528,7 @@ Methods:<br>
|
|||
- void Remove()
|
||||
- unsigned FindChild(UIElement* element) const
|
||||
- void SetParent(UIElement* parent, unsigned index = M_MAX_UNSIGNED)
|
||||
- void SetVar(ShortStringHash key, const Variant& value)
|
||||
- void SetInternal(bool enable)
|
||||
- void SetTraversalMode(TraversalMode traversalMode)
|
||||
- void SetElementEventSender(bool flag)
|
||||
|
@ -4578,6 +4579,8 @@ Methods:<br>
|
|||
- UIElement* GetParent() const
|
||||
- UIElement* GetRoot() const
|
||||
- const Color& GetDerivedColor() const
|
||||
- const Variant& GetVar(ShortStringHash key) const
|
||||
- const VariantMap& GetVars() const
|
||||
- IntVector2 ScreenToElement(const IntVector2& screenPosition)
|
||||
- IntVector2 ElementToScreen(const IntVector2& position)
|
||||
- bool IsInside(IntVector2 position, bool isScreen)
|
||||
|
|
|
@ -134,10 +134,11 @@ class UIElement : public Serializable
|
|||
void Remove();
|
||||
unsigned FindChild(UIElement* element) const;
|
||||
void SetParent(UIElement* parent, unsigned index = M_MAX_UNSIGNED);
|
||||
void SetVar(ShortStringHash key, const Variant& value);
|
||||
void SetInternal(bool enable);
|
||||
void SetTraversalMode(TraversalMode traversalMode);
|
||||
void SetElementEventSender(bool flag);
|
||||
|
||||
|
||||
const String& GetName() const;
|
||||
const IntVector2& GetPosition() const;
|
||||
const IntVector2& GetSize() const;
|
||||
|
@ -187,6 +188,8 @@ class UIElement : public Serializable
|
|||
UIElement* GetParent() const;
|
||||
UIElement* GetRoot() const;
|
||||
const Color& GetDerivedColor() const;
|
||||
const Variant& GetVar(ShortStringHash key) const;
|
||||
const VariantMap& GetVars() const;
|
||||
IntVector2 ScreenToElement(const IntVector2& screenPosition);
|
||||
IntVector2 ElementToScreen(const IntVector2& position);
|
||||
bool IsInside(IntVector2 position, bool isScreen);
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
|
||||
/// This first example, maintaining tradition, prints a "Hello World" message.
|
||||
/// Furthermore it shows:
|
||||
/// - Using the Sample / Application classes, which initialize the Urho3D engine and run the main loop;
|
||||
/// - Adding a Text element to the graphical user interface;
|
||||
/// - Subscribing to and handling of update events;
|
||||
/// - Using the Sample / Application classes, which initialize the Urho3D engine and run the main loop
|
||||
/// - Adding a Text element to the graphical user interface
|
||||
/// - Subscribing to and handling of update events
|
||||
class HelloWorld : public Sample
|
||||
{
|
||||
OBJECT(HelloWorld);
|
||||
|
|
|
@ -33,9 +33,9 @@ class Window;
|
|||
|
||||
/// A simple 'HelloWorld' GUI created purely from code.
|
||||
/// This sample demonstrates:
|
||||
/// - Creation of controls and building a UI hierarchy;
|
||||
/// - Loading UI style from XML and applying it to controls;
|
||||
/// - Handling of global and per-control events;
|
||||
/// - Creation of controls and building a UI hierarchy
|
||||
/// - Loading UI style from XML and applying it to controls
|
||||
/// - Handling of global and per-control events
|
||||
class HelloGUI : public Sample
|
||||
{
|
||||
OBJECT(HelloGUI);
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
|
||||
/// Moving sprites example.
|
||||
/// This sample demonstrates:
|
||||
/// - Adding Sprite elements to the UI;
|
||||
/// - Storing custom data (sprite velocity) inside UI elements;
|
||||
/// - Handling frame update events in which the sprites are moved;
|
||||
/// - Adding Sprite elements to the UI
|
||||
/// - Storing custom data (sprite velocity) inside UI elements
|
||||
/// - Handling frame update events in which the sprites are moved
|
||||
class Sprites : public Sample
|
||||
{
|
||||
// Enable type information.
|
||||
|
|
|
@ -34,9 +34,9 @@ class Scene;
|
|||
|
||||
/// Static 3D scene example.
|
||||
/// This sample demonstrates:
|
||||
/// - Creating a 3D scene with static content;
|
||||
/// - Displaying the scene using the Renderer subsystem;
|
||||
/// - Handling keyboard and mouse input to move a freelook camera;
|
||||
/// - Creating a 3D scene with static content
|
||||
/// - Displaying the scene using the Renderer subsystem
|
||||
/// - Handling keyboard and mouse input to move a freelook camera
|
||||
class StaticScene : public Sample
|
||||
{
|
||||
OBJECT(StaticScene);
|
||||
|
|
|
@ -34,9 +34,9 @@ class Scene;
|
|||
|
||||
/// Animating 3D scene example.
|
||||
/// This sample demonstrates:
|
||||
/// - Creating a 3D scene and using a custom component to animate the objects;
|
||||
/// - Controlling scene ambience with the Zone component;
|
||||
/// - Attaching a light to an object (the camera);
|
||||
/// - Creating a 3D scene and using a custom component to animate the objects
|
||||
/// - Controlling scene ambience with the Zone component
|
||||
/// - Attaching a light to an object (the camera)
|
||||
class AnimatingScene : public Sample
|
||||
{
|
||||
OBJECT(AnimatingScene);
|
||||
|
|
|
@ -35,10 +35,10 @@ class Scene;
|
|||
/// Skeletal animation example.
|
||||
/// This sample demonstrates:
|
||||
/// - Populating a 3D scene with skeletally animated AnimatedModel components;
|
||||
/// - Moving the animated models and advancing their animation using a custom component;
|
||||
/// - Moving the animated models and advancing their animation using a custom component
|
||||
/// - Enabling a cascaded shadow map on a directional light, which allows high-quality shadows
|
||||
/// over a large area (typically used in outdoor scenes for shadows cast by sunlight);
|
||||
/// - Displaying renderer debug geometry;
|
||||
/// over a large area (typically used in outdoor scenes for shadows cast by sunlight)
|
||||
/// - Displaying renderer debug geometry
|
||||
class SkeletalAnimation : public Sample
|
||||
{
|
||||
OBJECT(SkeletalAnimation);
|
||||
|
|
|
@ -34,9 +34,9 @@ class Scene;
|
|||
|
||||
/// Billboard example.
|
||||
/// This sample demonstrates:
|
||||
/// - Populating a 3D scene with billboard sets and several shadow casting spotlights;
|
||||
/// - Parenting scene nodes to allow more intuitive creation of groups of objects;
|
||||
/// - Examining rendering performance with a somewhat large object and light count;
|
||||
/// - Populating a 3D scene with billboard sets and several shadow casting spotlights
|
||||
/// - Parenting scene nodes to allow more intuitive creation of groups of objects
|
||||
/// - Examining rendering performance with a somewhat large object and light count
|
||||
class Billboards : public Sample
|
||||
{
|
||||
OBJECT(Billboards);
|
||||
|
|
|
@ -35,10 +35,10 @@ class Scene;
|
|||
|
||||
/// Decals example.
|
||||
/// This sample demonstrates:
|
||||
/// - Performing a raycast to the octree and adding a decal to the hit location;
|
||||
/// - Defining a Cursor UI element which stays inside the window and can be shown/hidden;
|
||||
/// - Marking suitable (large) objects as occluders for occlusion culling;
|
||||
/// - Displaying renderer debug geometry to see the effect of occlusion;
|
||||
/// - Performing a raycast to the octree and adding a decal to the hit location
|
||||
/// - Defining a Cursor UI element which stays inside the window and can be shown/hidden
|
||||
/// - Marking suitable (large) objects as occluders for occlusion culling
|
||||
/// - Displaying renderer debug geometry to see the effect of occlusion
|
||||
class Decals : public Sample
|
||||
{
|
||||
OBJECT(Decals);
|
||||
|
|
|
@ -34,8 +34,8 @@ class Scene;
|
|||
|
||||
/// Multiple viewports example.
|
||||
/// This sample demonstrates:
|
||||
/// - Setting up two viewports with two separate cameras;
|
||||
/// - Adding post processing effects to a viewport's render path and toggling them;
|
||||
/// - Setting up two viewports with two separate cameras
|
||||
/// - Adding post processing effects to a viewport's render path and toggling them
|
||||
class MultipleViewports : public Sample
|
||||
{
|
||||
OBJECT(MultipleViewports);
|
||||
|
|
|
@ -34,8 +34,8 @@ class Scene;
|
|||
|
||||
/// Render to texture example
|
||||
/// This sample demonstrates:
|
||||
/// - Creating two 3D scenes and rendering the other into a texture;
|
||||
/// - Creating rendertarget textures and materials programmatically;
|
||||
/// - Creating two 3D scenes and rendering the other into a texture
|
||||
/// - Creating rendertarget texture and material programmatically
|
||||
class RenderToTexture : public Sample
|
||||
{
|
||||
OBJECT(RenderToTexture);
|
||||
|
|
|
@ -34,10 +34,10 @@ class Scene;
|
|||
|
||||
/// Physics example.
|
||||
/// This sample demonstrates:
|
||||
/// - Creating both static and moving physics objects to a scene;
|
||||
/// - Displaying physics debug geometry;
|
||||
/// - Using the Skybox component for setting up an unmoving sky;
|
||||
/// - Saving a scene to a file and loading it to restore a previous state;
|
||||
/// - Creating both static and moving physics objects to a scene
|
||||
/// - Displaying physics debug geometry
|
||||
/// - Using the Skybox component for setting up an unmoving sky
|
||||
/// - Saving a scene to a file and loading it to restore a previous state
|
||||
class Physics : public Sample
|
||||
{
|
||||
OBJECT(Physics);
|
||||
|
|
|
@ -34,9 +34,9 @@ class Scene;
|
|||
|
||||
/// Physics stress test example.
|
||||
/// This sample demonstrates:
|
||||
/// - Physics and rendering performance with a high (1000) moving object count;
|
||||
/// - Using triangle meshes for collision;
|
||||
/// - Optimizing physics simulation by leaving out collision event signaling;
|
||||
/// - Physics and rendering performance with a high (1000) moving object count
|
||||
/// - Using triangle meshes for collision
|
||||
/// - Optimizing physics simulation by leaving out collision event signaling
|
||||
class PhysicsStressTest : public Sample
|
||||
{
|
||||
OBJECT(PhysicsStressTest);
|
||||
|
|
|
@ -34,9 +34,9 @@ class Scene;
|
|||
|
||||
/// Ragdoll example.
|
||||
/// This sample demonstrates:
|
||||
/// - Detecting physics collisions;
|
||||
/// - Moving an AnimatedModel's bones with physics and connecting them with constraints;
|
||||
/// - Using rolling friction to stop rolling objects from moving infinitely;
|
||||
/// - Detecting physics collisions
|
||||
/// - Moving an AnimatedModel's bones with physics and connecting them with constraints
|
||||
/// - Using rolling friction to stop rolling objects from moving infinitely
|
||||
class Ragdolls : public Sample
|
||||
{
|
||||
OBJECT(Ragdolls);
|
||||
|
|
|
@ -35,8 +35,8 @@ class Slider;
|
|||
|
||||
/// Sound effects example
|
||||
/// This sample demonstrates:
|
||||
/// - Playing sound effects and music;
|
||||
/// - Controlling sound and music master volume;
|
||||
/// - Playing sound effects and music
|
||||
/// - Controlling sound and music master volume
|
||||
class SoundEffects : public Sample
|
||||
{
|
||||
OBJECT(SoundEffects);
|
||||
|
|
|
@ -35,10 +35,10 @@ class Scene;
|
|||
|
||||
/// Navigation example.
|
||||
/// This sample demonstrates:
|
||||
/// - Generating a navigation mesh into the scene;
|
||||
/// - Performing path queries to the navigation mesh;
|
||||
/// - Rebuilding the navigation mesh partially when adding or removing objects;
|
||||
/// - Visualizing custom debug geometry;
|
||||
/// - Generating a navigation mesh into the scene
|
||||
/// - Performing path queries to the navigation mesh
|
||||
/// - Rebuilding the navigation mesh partially when adding or removing objects
|
||||
/// - Visualizing custom debug geometry
|
||||
class Navigation : public Sample
|
||||
{
|
||||
OBJECT(Navigation);
|
||||
|
|
|
@ -36,8 +36,8 @@ class UIElement;
|
|||
|
||||
/// Chat example
|
||||
/// This sample demonstrates:
|
||||
/// - Starting up a network server or connecting to it;
|
||||
/// - Implementing simple chat functionality with network messages;
|
||||
/// - Starting up a network server or connecting to it
|
||||
/// - Implementing simple chat functionality with network messages
|
||||
class Chat : public Sample
|
||||
{
|
||||
OBJECT(Chat);
|
||||
|
|
|
@ -37,10 +37,10 @@ class UIElement;
|
|||
|
||||
/// Scene network replication example.
|
||||
/// This sample demonstrates:
|
||||
/// - Creating a scene in which network clients can join;
|
||||
/// - Giving each client an object to control and sending the controls from the clients to the server,
|
||||
/// where the authoritative simulation happens;
|
||||
/// - Controlling a physics object's movement by applying forces;
|
||||
/// - Creating a scene in which network clients can join
|
||||
/// - Giving each client an object to control and sending the controls from the clients to the server
|
||||
/// where the authoritative simulation happens
|
||||
/// - Controlling a physics object's movement by applying forces
|
||||
class SceneReplication : public Sample
|
||||
{
|
||||
OBJECT(SceneReplication);
|
||||
|
|
|
@ -36,11 +36,10 @@ class Character;
|
|||
|
||||
/// Moving character example.
|
||||
/// This sample demonstrates:
|
||||
/// - Controlling a humanoid character through physics;
|
||||
/// - Driving animations using the AnimationController component;
|
||||
/// - Implementing 1st and 3rd person cameras, using raycasts to avoid the 3rd person camera
|
||||
/// clipping into scenery;
|
||||
/// - Defining attributes of a custom component so that it can be saved and loaded;
|
||||
/// - Controlling a humanoid character through physics
|
||||
/// - Driving animations using the AnimationController component
|
||||
/// - Implementing 1st and 3rd person cameras, using raycasts to avoid the 3rd person camera clipping into scenery
|
||||
/// - Defining attributes of a custom component so that it can be saved and loaded
|
||||
class CharacterDemo : public Sample
|
||||
{
|
||||
OBJECT(CharacterDemo);
|
||||
|
|
|
@ -36,9 +36,9 @@ class Vehicle;
|
|||
|
||||
/// Vehicle example.
|
||||
/// This sample demonstrates:
|
||||
/// - Creating a heightmap terrain with collision;
|
||||
/// - Constructing a physical vehicle with rigid bodies for the hull and the wheels, joined with constraints;
|
||||
/// - Defining attributes (including node and component references) of a custom component so that it can be saved and loaded;
|
||||
/// - Creating a heightmap terrain with collision
|
||||
/// - Constructing a physical vehicle with rigid bodies for the hull and the wheels, joined with constraints
|
||||
/// - Defining attributes (including node and component references) of a custom component so that it can be saved and loaded
|
||||
class VehicleDemo : public Sample
|
||||
{
|
||||
OBJECT(VehicleDemo);
|
||||
|
|
|
@ -34,11 +34,11 @@ class Scene;
|
|||
|
||||
/// Huge object count example.
|
||||
/// This sample demonstrates:
|
||||
/// - Creating a scene with 250 x 250 simple objects;
|
||||
/// - Creating a scene with 250 x 250 simple objects
|
||||
/// - Competing with http://yosoygames.com.ar/wp/2013/07/ogre-2-0-is-up-to-3x-faster/ :)
|
||||
/// - Allowing examination of performance hotspots in the rendering code;
|
||||
/// - Using the profiler to measure the time taken to animate the scene;
|
||||
/// - Optionally speeding up rendering by grouping the objects using StaticModelGroup component;
|
||||
/// - Allowing examination of performance hotspots in the rendering code
|
||||
/// - Using the profiler to measure the time taken to animate the scene
|
||||
/// - Optionally speeding up rendering by grouping objects with the StaticModelGroup component
|
||||
class HugeObjectCount : public Sample
|
||||
{
|
||||
OBJECT(HugeObjectCount);
|
||||
|
|
Загрузка…
Ссылка в новой задаче