Ver Fonte

Merge branch 'next' of https://github.com/blackberry/GamePlay into next

Conflicts:
	gameplay/gameplay.vcxproj.filters
seanpaultaylor há 12 anos atrás
pai
commit
66b588040e
96 ficheiros alterados com 6705 adições e 1393 exclusões
  1. 6 0
      gameplay/CMakeLists.txt
  2. 40 42
      gameplay/android/java/src/org/gameplay3d/GamePlayActivity.java
  3. 39 53
      gameplay/android/java/src/org/gameplay3d/GooglePlayClientHelper.java
  4. 3 4
      gameplay/android/java/src/org/gameplay3d/GooglePlaySocial.java
  5. 0 12
      gameplay/android/java/src/org/gameplay3d/lib/TestClass.java
  6. 8 2
      gameplay/gameplay.vcxproj
  7. 353 335
      gameplay/gameplay.vcxproj.filters
  8. 13 3
      gameplay/src/CheckBox.cpp
  9. 110 10
      gameplay/src/Container.cpp
  10. 1 0
      gameplay/src/Container.h
  11. 287 121
      gameplay/src/Control.cpp
  12. 193 67
      gameplay/src/Control.h
  13. 20 3
      gameplay/src/FlowLayout.cpp
  14. 32 0
      gameplay/src/FlowLayout.h
  15. 118 244
      gameplay/src/Form.cpp
  16. 20 49
      gameplay/src/Form.h
  17. 2 0
      gameplay/src/Game.h
  18. 19 1
      gameplay/src/ImageControl.cpp
  19. 5 0
      gameplay/src/ImageControl.h
  20. 12 1
      gameplay/src/Label.cpp
  21. 15 28
      gameplay/src/Layout.cpp
  22. 1 1
      gameplay/src/ParticleEmitter.cpp
  23. 2 0
      gameplay/src/Platform.cpp
  24. 13 17
      gameplay/src/Properties.cpp
  25. 8 5
      gameplay/src/Properties.h
  26. 13 3
      gameplay/src/RadioButton.cpp
  27. 17 5
      gameplay/src/ScriptController.cpp
  28. 13 1
      gameplay/src/Slider.cpp
  29. 2 0
      gameplay/src/SocialAchievement.h
  30. 2 0
      gameplay/src/SocialChallenge.h
  31. 2 2
      gameplay/src/SocialController.cpp
  32. 2 1
      gameplay/src/SocialController.h
  33. 2 0
      gameplay/src/SocialPlayer.h
  34. 3 1
      gameplay/src/SocialScore.h
  35. 2 0
      gameplay/src/SocialSession.h
  36. 2 0
      gameplay/src/SocialSessionListener.h
  37. 1 1
      gameplay/src/SpriteBatch.cpp
  38. 9 8
      gameplay/src/Theme.cpp
  39. 12 2
      gameplay/src/VerticalLayout.cpp
  40. 19 0
      gameplay/src/VerticalLayout.h
  41. 72 0
      gameplay/src/lua/lua_Bundle.cpp
  42. 2 0
      gameplay/src/lua/lua_Bundle.h
  43. 367 24
      gameplay/src/lua/lua_Button.cpp
  44. 6 0
      gameplay/src/lua/lua_Button.h
  45. 367 24
      gameplay/src/lua/lua_CheckBox.cpp
  46. 6 0
      gameplay/src/lua/lua_CheckBox.h
  47. 369 26
      gameplay/src/lua/lua_Container.cpp
  48. 6 0
      gameplay/src/lua/lua_Container.h
  49. 367 24
      gameplay/src/lua/lua_Control.cpp
  50. 6 0
      gameplay/src/lua/lua_Control.h
  51. 36 0
      gameplay/src/lua/lua_ControlAutoSize.cpp
  52. 15 0
      gameplay/src/lua/lua_ControlAutoSize.h
  53. 1 0
      gameplay/src/lua/lua_ControlListener.cpp
  54. 113 0
      gameplay/src/lua/lua_FlowLayout.cpp
  55. 3 0
      gameplay/src/lua/lua_FlowLayout.h
  56. 37 0
      gameplay/src/lua/lua_Font.cpp
  57. 1 0
      gameplay/src/lua/lua_Font.h
  58. 31 0
      gameplay/src/lua/lua_FontFormat.cpp
  59. 15 0
      gameplay/src/lua/lua_FontFormat.h
  60. 1 0
      gameplay/src/lua/lua_FontText.cpp
  61. 369 26
      gameplay/src/lua/lua_Form.cpp
  62. 6 0
      gameplay/src/lua/lua_Form.h
  63. 44 44
      gameplay/src/lua/lua_Game.cpp
  64. 31 0
      gameplay/src/lua/lua_Global.cpp
  65. 3 0
      gameplay/src/lua/lua_Global.h
  66. 367 24
      gameplay/src/lua/lua_ImageControl.cpp
  67. 6 0
      gameplay/src/lua/lua_ImageControl.h
  68. 367 24
      gameplay/src/lua/lua_Joystick.cpp
  69. 6 0
      gameplay/src/lua/lua_Joystick.h
  70. 367 24
      gameplay/src/lua/lua_Label.cpp
  71. 6 0
      gameplay/src/lua/lua_Label.h
  72. 1 0
      gameplay/src/lua/lua_Material.cpp
  73. 481 0
      gameplay/src/lua/lua_ParticleEmitter.cpp
  74. 12 0
      gameplay/src/lua/lua_ParticleEmitter.h
  75. 1 0
      gameplay/src/lua/lua_Pass.cpp
  76. 68 2
      gameplay/src/lua/lua_Properties.cpp
  77. 367 24
      gameplay/src/lua/lua_RadioButton.cpp
  78. 6 0
      gameplay/src/lua/lua_RadioButton.h
  79. 1 0
      gameplay/src/lua/lua_RenderState.cpp
  80. 31 0
      gameplay/src/lua/lua_RenderStateFrontFace.cpp
  81. 15 0
      gameplay/src/lua/lua_RenderStateFrontFace.h
  82. 38 0
      gameplay/src/lua/lua_RenderStateStateBlock.cpp
  83. 1 0
      gameplay/src/lua/lua_RenderStateStateBlock.h
  84. 367 24
      gameplay/src/lua/lua_Slider.cpp
  85. 6 0
      gameplay/src/lua/lua_Slider.h
  86. 1 0
      gameplay/src/lua/lua_Technique.cpp
  87. 367 24
      gameplay/src/lua/lua_TextBox.cpp
  88. 6 0
      gameplay/src/lua/lua_TextBox.h
  89. 73 0
      gameplay/src/lua/lua_VerticalLayout.cpp
  90. 2 0
      gameplay/src/lua/lua_VerticalLayout.h
  91. 26 37
      gameplay/src/social/GooglePlaySocialSession.cpp
  92. 8 8
      gameplay/src/social/GooglePlaySocialSession.h
  93. 1 1
      samples/browser/res/common/forms/formSelect.form
  94. 8 7
      samples/browser/src/LightSample.cpp
  95. 2 2
      samples/browser/src/TextSample.cpp
  96. 2 2
      tools/luagen/gameplay-luagen.sln

+ 6 - 0
gameplay/CMakeLists.txt

@@ -306,6 +306,8 @@ set(GAMEPLAY_LUA
     src/lua/lua_Control.h
     src/lua/lua_ControlAlignment.cpp
     src/lua/lua_ControlAlignment.h
+    src/lua/lua_ControlAutoSize.cpp
+    src/lua/lua_ControlAutoSize.h
     src/lua/lua_ControlListener.cpp
     src/lua/lua_ControlListener.h
     src/lua/lua_ControlListenerEventType.cpp
@@ -328,6 +330,8 @@ set(GAMEPLAY_LUA
     src/lua/lua_FlowLayout.h
     src/lua/lua_Font.cpp
     src/lua/lua_Font.h
+    src/lua/lua_FontFormat.cpp
+    src/lua/lua_FontFormat.h
     src/lua/lua_FontJustify.cpp
     src/lua/lua_FontJustify.h
     src/lua/lua_FontStyle.cpp
@@ -505,6 +509,8 @@ set(GAMEPLAY_LUA
     src/lua/lua_RenderStateCullFaceSide.cpp
     src/lua/lua_RenderStateDepthFunction.cpp
     src/lua/lua_RenderStateDepthFunction.h
+    src/lua/lua_RenderStateFrontFace.cpp
+    src/lua/lua_RenderStateFrontFace.h
     src/lua/lua_RenderStateStateBlock.cpp
     src/lua/lua_RenderStateStateBlock.h
     src/lua/lua_RenderStateStencilFunction.cpp

+ 40 - 42
gameplay/android/java/src/org/gameplay3d/lib/BaseGameActivity.java → gameplay/android/java/src/org/gameplay3d/GamePlayActivity.java

@@ -14,12 +14,11 @@
  * limitations under the License.
  */
 
-package org.gameplay3d.sample_spaceship.basegameutils;
+package org.gameplay3d;
 
 import android.content.Intent;
 import android.os.Bundle;
 import android.support.v4.app.FragmentActivity;
-
 import com.google.android.gms.appstate.AppStateClient;
 import com.google.android.gms.common.ConnectionResult;
 import com.google.android.gms.games.GamesClient;
@@ -32,28 +31,27 @@ import com.google.android.gms.plus.PlusClient;
  * methods. To initiate the sign-in flow when the user clicks the sign-in
  * button, subclasses should call @link{#beginUserInitiatedSignIn}. By default,
  * this class only instantiates the GamesClient object. If the PlusClient or
- * AppStateClient objects are also wanted, call the BaseGameActivity(int)
+ * AppStateClient objects are also wanted, call the BaseGooglePlayActivity(int)
  * constructor and specify the requested clients. For example, to request
- * PlusClient and GamesClient, use BaseGameActivity(CLIENT_GAMES | CLIENT_PLUS).
- * To request all available clients, use BaseGameActivity(CLIENT_ALL).
+ * PlusClient and GamesClient, use BaseGooglePlayActivity(CLIENT_GAMES | CLIENT_PLUS).
+ * To request all available clients, use BaseGooglePlayActivity(CLIENT_ALL).
  * Alternatively, you can also specify the requested clients via
  * @link{#setRequestedClients}, but you must do so before @link{#onCreate}
  * gets called, otherwise the call will have no effect.
  *
  * @author Bruno Oliveira (Google)
  */
-public abstract class BaseGameActivity extends FragmentActivity implements
-        GameHelper.GameHelperListener {
+public abstract class GooglePlayActivity extends FragmentActivity implements GooglePlayClientHelper.GamePlayClientHelperListener {
 
     // The game helper object. This class is mainly a wrapper around this object.
-    protected GameHelper mHelper;
+    protected GamePlayClientHelper mClient;
 
     // We expose these constants here because we don't want users of this class
-    // to have to know about GameHelper at all.
-    public static final int CLIENT_GAMES = GameHelper.CLIENT_GAMES;
-    public static final int CLIENT_APPSTATE = GameHelper.CLIENT_APPSTATE;
-    public static final int CLIENT_PLUS = GameHelper.CLIENT_PLUS;
-    public static final int CLIENT_ALL = GameHelper.CLIENT_ALL;
+    // to have to know about GamePlayClientHelper at all.
+    public static final int CLIENT_GAMES = GamePlayClientHelper.CLIENT_GAMES;
+    public static final int CLIENT_APPSTATE = GamePlayClientHelper.CLIENT_APPSTATE;
+    public static final int CLIENT_PLUS = GamePlayClientHelper.CLIENT_PLUS;
+    public static final int CLIENT_ALL = GamePlayClientHelper.CLIENT_ALL;
 
     // Requested clients. By default, that's just the games client.
     protected int mRequestedClients = CLIENT_GAMES;
@@ -61,21 +59,21 @@ public abstract class BaseGameActivity extends FragmentActivity implements
     // stores any additional scopes.
     private String[] mAdditionalScopes;
 
-    protected String mDebugTag = "BaseGameActivity";
+    protected String mDebugTag = "GooglePlayActivity";
     protected boolean mDebugLog = false;
 
-    /** Constructs a BaseGameActivity with default client (GamesClient). */
-    protected BaseGameActivity() {
+    /** Constructs a BaseGooglePlayActivity with default client (GamesClient). */
+    protected GooglePlayActivity() {
         super();
-        mHelper = new GameHelper(this);
+        mClient = new GamePlayClientHelper(this);
     }
 
     /**
-     * Constructs a BaseGameActivity with the requested clients.
+     * Constructs a GooglePlayActivity with the requested clients.
      * @param requestedClients The requested clients (a combination of CLIENT_GAMES,
      *         CLIENT_PLUS and CLIENT_APPSTATE).
      */
-    protected BaseGameActivity(int requestedClients) {
+    protected GooglePlayActivity(int requestedClients) {
         super();
         setRequestedClients(requestedClients);
     }
@@ -99,92 +97,92 @@ public abstract class BaseGameActivity extends FragmentActivity implements
     @Override
     protected void onCreate(Bundle b) {
         super.onCreate(b);
-        mHelper = new GameHelper(this);
+        mClient = new GamePlayClientHelper(this);
         if (mDebugLog) {
-            mHelper.enableDebugLog(mDebugLog, mDebugTag);
+            mClient.enableDebugLog(mDebugLog, mDebugTag);
         }
-        mHelper.setup(this, mRequestedClients, mAdditionalScopes);
+        mClient.setup(this, mRequestedClients, mAdditionalScopes);
     }
 
     @Override
     protected void onStart() {
         super.onStart();
-        mHelper.onStart(this);
+        mClient.onStart(this);
     }
 
     @Override
     protected void onStop() {
         super.onStop();
-        mHelper.onStop();
+        mClient.onStop();
     }
 
     @Override
     protected void onActivityResult(int request, int response, Intent data) {
         super.onActivityResult(request, response, data);
-        mHelper.onActivityResult(request, response, data);
+        mClient.onActivityResult(request, response, data);
     }
 
     protected GamesClient getGamesClient() {
-        return mHelper.getGamesClient();
+        return mClient.getGamesClient();
     }
 
     protected AppStateClient getAppStateClient() {
-        return mHelper.getAppStateClient();
+        return mClient.getAppStateClient();
     }
 
     protected PlusClient getPlusClient() {
-        return mHelper.getPlusClient();
+        return mClient.getPlusClient();
     }
 
     protected boolean isSignedIn() {
-        return mHelper.isSignedIn();
+        return mClient.isSignedIn();
     }
 
     protected void beginUserInitiatedSignIn() {
-        mHelper.beginUserInitiatedSignIn();
+        mClient.beginUserInitiatedSignIn();
     }
 
     protected void signOut() {
-        mHelper.signOut();
+        mClient.signOut();
     }
 
     protected void showAlert(String title, String message) {
-        mHelper.showAlert(title, message);
+        mClient.showAlert(title, message);
     }
 
     protected void showAlert(String message) {
-        mHelper.showAlert(message);
+        mClient.showAlert(message);
     }
 
     protected void enableDebugLog(boolean enabled, String tag) {
         mDebugLog = true;
         mDebugTag = tag;
-        if (mHelper != null) {
-            mHelper.enableDebugLog(enabled, tag);
+        if (mClient != null) {
+            mClient.enableDebugLog(enabled, tag);
         }
     }
 
     protected String getInvitationId() {
-        return mHelper.getInvitationId();
+        return mClient.getInvitationId();
     }
 
     protected void reconnectClients(int whichClients) {
-        mHelper.reconnectClients(whichClients);
+        mClient.reconnectClients(whichClients);
     }
 
     protected String getScopes() {
-        return mHelper.getScopes();
+        return mClient.getScopes();
     }
 
     protected String[] getScopesArray() {
-        return mHelper.getScopesArray();
+        return mClient.getScopesArray();
     }
 
     protected boolean hasSignInError() {
-        return mHelper.hasSignInError();
+        return mClient.hasSignInError();
     }
 
-    protected GameHelper.SignInFailureReason getSignInError() {
-        return mHelper.getSignInError();
+    protected GamePlayClientHelper.SignInFailureReason getSignInError() {
+        return mClient.getSignInError();
     }
 }

+ 39 - 53
gameplay/android/java/src/org/gameplay3d/lib/GameHelper.java → gameplay/android/java/src/org/gameplay3d/GooglePlayClientHelper.java

@@ -1,20 +1,5 @@
-/*
- * Copyright (C) 2013 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.gameplay3d.sample_spaceship.basegameutils;
+
+package org.gameplay3d;
 
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
@@ -43,11 +28,12 @@ import com.google.android.gms.games.GamesClient;
 import com.google.android.gms.games.multiplayer.Invitation;
 import com.google.android.gms.plus.PlusClient;
 
-public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
-        GooglePlayServicesClient.OnConnectionFailedListener {
+public class GooglePlayClientHelper implements GooglePlayServicesClient.ConnectionCallbacks, GooglePlayServicesClient.OnConnectionFailedListener 
+{
 
     /** Listener for sign-in success or failure events. */
-    public interface GameHelperListener {
+    public interface GooglePlayClientHelperListener 
+    {
         /**
          * Called when sign-in fails. As a result, a "Sign-In" button can be
          * shown to the user; when that button is clicked, call
@@ -71,13 +57,13 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
     public static final int STATE_CONNECTED = 3;
 
     // State names (for debug logging, etc)
-    public static final String[] STATE_NAMES = {
+    public static final String[] STATE_NAMES = 
+    {
             "UNCONFIGURED", "DISCONNECTED", "CONNECTING", "CONNECTED"
     };
 
     // State we are in right now
     int mState = STATE_UNCONFIGURED;
-
     // Are we expecting the result of a resolution flow?
     boolean mExpectingResolution = false;
 
@@ -138,7 +124,7 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
 
     // Print debug logs?
     boolean mDebugLog = false;
-    String mDebugTag = "GameHelper";
+    String mDebugTag = "GooglePlayClientHelper";
 
     /*
      * If we got an invitation id when we connected to the games client, it's
@@ -147,19 +133,19 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
     String mInvitationId;
 
     // Listener
-    GameHelperListener mListener = null;
+    GooglePlayClientHelperListener mListener = null;
 
     /**
-     * Construct a GameHelper object, initially tied to the given Activity.
+     * Construct a GooglePlayClientHelper object, initially tied to the given Activity.
      * After constructing this object, call @link{setup} from the onCreate()
      * method of your Activity.
      */
-    public GameHelper(Activity activity) {
+    public GooglePlayClientHelper(Activity activity) {
         mActivity = activity;
     }
 
     static private final int TYPE_DEVELOPER_ERROR = 1001;
-    static private final int TYPE_GAMEHELPER_BUG = 1002;
+    static private final int TYPE_GooglePlayClientHelper_BUG = 1002;
     boolean checkState(int type, String operation, String warning, int... expectedStates) {
         for (int expectedState : expectedStates) {
             if (mState == expectedState) {
@@ -168,9 +154,9 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
         }
         StringBuilder sb = new StringBuilder();
         if (type == TYPE_DEVELOPER_ERROR) {
-            sb.append("GameHelper: you attempted an operation at an invalid. ");
+            sb.append("GooglePlayClientHelper: you attempted an operation at an invalid. ");
         } else {
-            sb.append("GameHelper: bug detected. Please report it at our bug tracker ");
+            sb.append("GooglePlayClientHelper: bug detected. Please report it at our bug tracker ");
             sb.append("https://github.com/playgameservices/android-samples/issues. ");
             sb.append("Please include the last couple hundred lines of logcat output ");
             sb.append("and describe the operation that caused this. ");
@@ -194,7 +180,7 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
 
     void assertConfigured(String operation) {
         if (mState == STATE_UNCONFIGURED) {
-            String error = "GameHelper error: Operation attempted without setup: " + operation +
+            String error = "GooglePlayClientHelper error: Operation attempted without setup: " + operation +
                     ". The setup() method must be called before attempting any other operation.";
             logError(error);
             throw new IllegalStateException(error);
@@ -202,15 +188,15 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
     }
 
     /**
-     * Same as calling @link{setup(GameHelperListener, int)} requesting only the
+     * Same as calling @link{setup(GooglePlayClientHelperListener, int)} requesting only the
      * CLIENT_GAMES client.
      */
-    public void setup(GameHelperListener listener) {
+    public void setup(GooglePlayClientHelperListener listener) {
         setup(listener, CLIENT_GAMES);
     }
 
     /**
-     * Performs setup on this GameHelper object. Call this from the onCreate()
+     * Performs setup on this GooglePlayClientHelper object. Call this from the onCreate()
      * method of your Activity. This will create the clients and do a few other
      * initialization tasks. Next, call @link{#onStart} from the onStart()
      * method of your Activity.
@@ -224,9 +210,9 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
      *            I.E. for YouTube uploads one would add
      *            "https://www.googleapis.com/auth/youtube.upload"
      */
-    public void setup(GameHelperListener listener, int clientsToUse, String ... additionalScopes) {
+    public void setup(GooglePlayClientHelperListener listener, int clientsToUse, String ... additionalScopes) {
         if (mState != STATE_UNCONFIGURED) {
-            String error = "GameHelper: you called GameHelper.setup() twice. You can only call " +
+            String error = "GooglePlayClientHelper: you called GooglePlayClientHelper.setup() twice. You can only call " +
                     "it once.";
             logError(error);
             throw new IllegalStateException(error);
@@ -416,9 +402,9 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
 
     /**
      * Returns the invitation ID received through an invitation notification.
-     * This should be called from your GameHelperListener's
+     * This should be called from your GooglePlayClientHelperListener's
      *
-     * @link{GameHelperListener#onSignInSucceeded} method, to check if there's an
+     * @link{GooglePlayClientHelperListener#onSignInSucceeded} method, to check if there's an
      * invitation available. In that case, accept the invitation.
      * @return The id of the invitation, or null if none was received.
      */
@@ -493,7 +479,7 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
     }
 
     void killConnections() {
-        if (!checkState(TYPE_GAMEHELPER_BUG, "killConnections", "killConnections() should only " +
+        if (!checkState(TYPE_GooglePlayClientHelper_BUG, "killConnections", "killConnections() should only " +
                 "get called while connected or connecting.", STATE_CONNECTED, STATE_CONNECTING)) {
             return;
         }
@@ -604,7 +590,7 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
     /**
      * Starts a user-initiated sign-in flow. This should be called when the user
      * clicks on a "Sign In" button. As a result, authentication/consent dialogs
-     * may show up. At the end of the process, the GameHelperListener's
+     * may show up. At the end of the process, the GooglePlayClientHelperListener's
      * onSignInSucceeded() or onSignInFailed() methods will be called.
      */
     public void beginUserInitiatedSignIn() {
@@ -672,7 +658,7 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
     }
 
     void startConnections() {
-        if (!checkState(TYPE_GAMEHELPER_BUG, "startConnections", "startConnections should " +
+        if (!checkState(TYPE_GooglePlayClientHelper_BUG, "startConnections", "startConnections should " +
                 "only get called when disconnected.", STATE_DISCONNECTED)) {
             return;
         }
@@ -735,10 +721,10 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
     void connectCurrentClient() {
         if (mState == STATE_DISCONNECTED) {
             // we got disconnected during the connection process, so abort
-            logWarn("GameHelper got disconnected during connection process. Aborting.");
+            logWarn("GooglePlayClientHelper got disconnected during connection process. Aborting.");
             return;
         }
-        if (!checkState(TYPE_GAMEHELPER_BUG, "connectCurrentClient", "connectCurrentClient " +
+        if (!checkState(TYPE_GooglePlayClientHelper_BUG, "connectCurrentClient", "connectCurrentClient " +
                 "should only get called when connecting.", STATE_CONNECTING)) {
             return;
         }
@@ -782,7 +768,7 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
         if ((whatClients & CLIENT_PLUS) != 0 && mPlusClient != null
                 && mPlusClient.isConnected()) {
             // PlusClient doesn't need reconnections.
-            logWarn("GameHelper is ignoring your request to reconnect " +
+            logWarn("GooglePlayClientHelper is ignoring your request to reconnect " +
                     "PlusClient because this is unnecessary.");
         }
 
@@ -823,7 +809,7 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
     }
 
     void succeedSignIn() {
-        checkState(TYPE_GAMEHELPER_BUG, "succeedSignIn", "succeedSignIn should only " +
+        checkState(TYPE_GooglePlayClientHelper_BUG, "succeedSignIn", "succeedSignIn should only " +
                 "get called in the connecting or connected state. Proceeding anyway.",
                 STATE_CONNECTING, STATE_CONNECTED);
         debugLog("All requested clients connected. Sign-in succeeded!");
@@ -875,7 +861,7 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
      */
     void resolveConnectionResult() {
         // Try to resolve the problem
-        checkState(TYPE_GAMEHELPER_BUG, "resolveConnectionResult",
+        checkState(TYPE_GooglePlayClientHelper_BUG, "resolveConnectionResult",
                 "resolveConnectionResult should only be called when connecting. Proceeding anyway.",
                 STATE_CONNECTING);
 
@@ -914,7 +900,7 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
      * new version, etc).
      */
     void giveUp(SignInFailureReason reason) {
-        checkState(TYPE_GAMEHELPER_BUG, "giveUp", "giveUp should only be called when " +
+        checkState(TYPE_GooglePlayClientHelper_BUG, "giveUp", "giveUp should only be called when " +
                 "connecting. Proceeding anyway.", STATE_CONNECTING);
         mAutoSignIn = false;
         killConnections();
@@ -960,16 +946,16 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
         switch (actResp) {
             case GamesActivityResultCodes.RESULT_APP_MISCONFIGURED:
                 errorDialog = makeSimpleDialog(ctx.getString(
-                        R.string.gamehelper_app_misconfigured));
+                        R.string.GooglePlayClientHelper_app_misconfigured));
                 printMisconfiguredDebugInfo();
                 break;
             case GamesActivityResultCodes.RESULT_SIGN_IN_FAILED:
                 errorDialog = makeSimpleDialog(ctx.getString(
-                        R.string.gamehelper_sign_in_failed));
+                        R.string.GooglePlayClientHelper_sign_in_failed));
                 break;
             case GamesActivityResultCodes.RESULT_LICENSE_FAILED:
                 errorDialog = makeSimpleDialog(ctx.getString(
-                        R.string.gamehelper_license_failed));
+                        R.string.GooglePlayClientHelper_license_failed));
                 break;
             default:
                 // No meaningful Activity response code, so generate default Google
@@ -979,7 +965,7 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
                 if (errorDialog == null) {
                     // get fallback dialog
                     debugLog("No standard error dialog available. Making fallback dialog.");
-                    errorDialog = makeSimpleDialog(ctx.getString(R.string.gamehelper_unknown_error)
+                    errorDialog = makeSimpleDialog(ctx.getString(R.string.GooglePlayClientHelper_unknown_error)
                             + " " + errorCodeToString(errorCode));
                 }
         }
@@ -995,16 +981,16 @@ public class GameHelper implements GooglePlayServicesClient.ConnectionCallbacks,
 
     void debugLog(String message) {
         if (mDebugLog) {
-            Log.d(mDebugTag, "GameHelper: " + message);
+            Log.d(mDebugTag, "GooglePlayClientHelper: " + message);
         }
     }
 
     void logWarn(String message) {
-        Log.w(mDebugTag, "!!! GameHelper WARNING: " + message);
+        Log.w(mDebugTag, "!!! GooglePlayClientHelper WARNING: " + message);
     }
 
     void logError(String message) {
-        Log.e(mDebugTag, "*** GameHelper ERROR: " + message);
+        Log.e(mDebugTag, "*** GooglePlayClientHelper ERROR: " + message);
     }
 
     static String errorCodeToString(int errorCode) {

+ 3 - 4
gameplay/android/java/src/org/gameplay3d/lib/GoogleGamesSocial.java → gameplay/android/java/src/org/gameplay3d/GooglePlaySocial.java

@@ -1,17 +1,16 @@
     
-package org.gameplay3d.lib;
+package org.gameplay3d;
 
 import android.content.Context;
 import android.os.Bundle;
 import android.support.v4.app.Fragment;
 import android.util.Log;
 import android.widget.Toast;
-
 import com.google.android.gms.games.Player;
 import com.google.example.games.basegameutils.BaseGameActivity;
 
-public class GoogleGamesSocial extends BaseGameActivity {
-	
+public class GooglePlaySocial extends BaseGameActivity 
+{	
 	private static List<Player> mFriends = new ArrayList<Player>();
     private static final int FRIENDS_PER_PAGE = 10;
 	

+ 0 - 12
gameplay/android/java/src/org/gameplay3d/lib/TestClass.java

@@ -1,12 +0,0 @@
-
-package org.gameplay3d.lib;
-
-public class TestClass
-{
-   public TestClass() { }
- 
-   public int ComputeMult(float a, float b)
-   {
-      return (int)(a * b);
-   }
-}

+ 8 - 2
gameplay/gameplay.vcxproj

@@ -131,6 +131,7 @@
     <ClCompile Include="src\lua\lua_ContainerScroll.cpp" />
     <ClCompile Include="src\lua\lua_Control.cpp" />
     <ClCompile Include="src\lua\lua_ControlAlignment.cpp" />
+    <ClCompile Include="src\lua\lua_ControlAutoSize.cpp" />
     <ClCompile Include="src\lua\lua_ControlListener.cpp" />
     <ClCompile Include="src\lua\lua_ControlListenerEventType.cpp" />
     <ClCompile Include="src\lua\lua_ControlState.cpp" />
@@ -142,6 +143,7 @@
     <ClCompile Include="src\lua\lua_FileSystem.cpp" />
     <ClCompile Include="src\lua\lua_FlowLayout.cpp" />
     <ClCompile Include="src\lua\lua_Font.cpp" />
+    <ClCompile Include="src\lua\lua_FontFormat.cpp" />
     <ClCompile Include="src\lua\lua_FontJustify.cpp" />
     <ClCompile Include="src\lua\lua_FontStyle.cpp" />
     <ClCompile Include="src\lua\lua_FontText.cpp" />
@@ -231,6 +233,7 @@
     <ClCompile Include="src\lua\lua_RenderStateBlend.cpp" />
     <ClCompile Include="src\lua\lua_RenderStateCullFaceSide.cpp" />
     <ClCompile Include="src\lua\lua_RenderStateDepthFunction.cpp" />
+    <ClCompile Include="src\lua\lua_RenderStateFrontFace.cpp" />
     <ClCompile Include="src\lua\lua_RenderStateStateBlock.cpp" />
     <ClCompile Include="src\lua\lua_RenderStateStencilFunction.cpp" />
     <ClCompile Include="src\lua\lua_RenderStateStencilOperation.cpp" />
@@ -326,7 +329,7 @@
     <ClCompile Include="src\SocialPlayer.cpp" />
     <ClCompile Include="src\SocialScore.cpp" />
     <ClCompile Include="src\SocialSessionListener.cpp" />
-    <ClCompile Include="src\social\GoogleGamesSocialSession.cpp" />
+    <ClCompile Include="src\social\GooglePlaySocialSession.cpp" />
     <ClCompile Include="src\social\ScoreloopSocialSession.cpp" />
     <ClCompile Include="src\SpriteBatch.cpp" />
     <ClCompile Include="src\Technique.cpp" />
@@ -426,6 +429,7 @@
     <ClInclude Include="src\lua\lua_ContainerScroll.h" />
     <ClInclude Include="src\lua\lua_Control.h" />
     <ClInclude Include="src\lua\lua_ControlAlignment.h" />
+    <ClInclude Include="src\lua\lua_ControlAutoSize.h" />
     <ClInclude Include="src\lua\lua_ControlListener.h" />
     <ClInclude Include="src\lua\lua_ControlListenerEventType.h" />
     <ClInclude Include="src\lua\lua_ControlState.h" />
@@ -437,6 +441,7 @@
     <ClInclude Include="src\lua\lua_FileSystem.h" />
     <ClInclude Include="src\lua\lua_FlowLayout.h" />
     <ClInclude Include="src\lua\lua_Font.h" />
+    <ClInclude Include="src\lua\lua_FontFormat.h" />
     <ClInclude Include="src\lua\lua_FontJustify.h" />
     <ClInclude Include="src\lua\lua_FontStyle.h" />
     <ClInclude Include="src\lua\lua_FontText.h" />
@@ -526,6 +531,7 @@
     <ClInclude Include="src\lua\lua_RenderStateBlend.h" />
     <ClInclude Include="src\lua\lua_RenderStateCullFaceSide.h" />
     <ClInclude Include="src\lua\lua_RenderStateDepthFunction.h" />
+    <ClInclude Include="src\lua\lua_RenderStateFrontFace.h" />
     <ClInclude Include="src\lua\lua_RenderStateStateBlock.h" />
     <ClInclude Include="src\lua\lua_RenderStateStencilFunction.h" />
     <ClInclude Include="src\lua\lua_RenderStateStencilOperation.h" />
@@ -619,7 +625,7 @@
     <ClInclude Include="src\SocialScore.h" />
     <ClInclude Include="src\SocialSession.h" />
     <ClInclude Include="src\SocialSessionListener.h" />
-    <ClInclude Include="src\social\GoogleGamesSocialSession.h" />
+    <ClInclude Include="src\social\GooglePlaySocialSession.h" />
     <ClInclude Include="src\social\ScoreloopSocialSession.h" />
     <ClInclude Include="src\SpriteBatch.h" />
     <ClInclude Include="src\Stream.h" />

+ 353 - 335
gameplay/gameplay.vcxproj.filters

@@ -18,12 +18,78 @@
     </Filter>
   </ItemGroup>
   <ItemGroup>
+    <ClCompile Include="src\Animation.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\AnimationClip.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\AnimationController.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\AnimationValue.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\BoundingBox.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\BoundingSphere.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\Camera.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\Curve.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\Effect.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\FileSystem.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\Font.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\Frustum.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\Game.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\Light.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\Matrix.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\Mesh.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\MeshPart.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\MeshSkin.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\Model.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\Node.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
     <ClCompile Include="src\Plane.cpp">
       <Filter>src</Filter>
     </ClCompile>
+    <ClCompile Include="src\gameplay-main-blackberry.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
     <ClCompile Include="src\PlatformBlackBerry.cpp">
       <Filter>src</Filter>
     </ClCompile>
+    <ClCompile Include="src\gameplay-main-windows.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
     <ClCompile Include="src\PlatformWindows.cpp">
       <Filter>src</Filter>
     </ClCompile>
@@ -66,12 +132,36 @@
     <ClCompile Include="src\VertexFormat.cpp">
       <Filter>src</Filter>
     </ClCompile>
+    <ClCompile Include="src\AudioController.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\AudioListener.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\AudioSource.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\AudioBuffer.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\AnimationTarget.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\MaterialParameter.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\Joint.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
     <ClCompile Include="src\ParticleEmitter.cpp">
       <Filter>src</Filter>
     </ClCompile>
     <ClCompile Include="src\Properties.cpp">
       <Filter>src</Filter>
     </ClCompile>
+    <ClCompile Include="src\Material.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
     <ClCompile Include="src\Technique.cpp">
       <Filter>src</Filter>
     </ClCompile>
@@ -81,6 +171,9 @@
     <ClCompile Include="src\RenderState.cpp">
       <Filter>src</Filter>
     </ClCompile>
+    <ClCompile Include="src\DebugNew.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
     <ClCompile Include="src\PhysicsController.cpp">
       <Filter>src</Filter>
     </ClCompile>
@@ -108,15 +201,45 @@
     <ClCompile Include="src\SceneLoader.cpp">
       <Filter>src</Filter>
     </ClCompile>
+    <ClCompile Include="src\Image.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
     <ClCompile Include="src\RenderTarget.cpp">
       <Filter>src</Filter>
     </ClCompile>
+    <ClCompile Include="src\FrameBuffer.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\DepthStencilTarget.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\MeshBatch.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\gameplay-main-android.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
     <ClCompile Include="src\PlatformAndroid.cpp">
       <Filter>src</Filter>
     </ClCompile>
     <ClCompile Include="src\AbsoluteLayout.cpp">
       <Filter>src</Filter>
     </ClCompile>
+    <ClCompile Include="src\Button.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\CheckBox.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\Container.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\Control.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\Label.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
     <ClCompile Include="src\RadioButton.cpp">
       <Filter>src</Filter>
     </ClCompile>
@@ -126,6 +249,9 @@
     <ClCompile Include="src\VerticalLayout.cpp">
       <Filter>src</Filter>
     </ClCompile>
+    <ClCompile Include="src\Form.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
     <ClCompile Include="src\Theme.cpp">
       <Filter>src</Filter>
     </ClCompile>
@@ -147,6 +273,18 @@
     <ClCompile Include="src\ThemeStyle.cpp">
       <Filter>src</Filter>
     </ClCompile>
+    <ClCompile Include="src\Layout.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\Bundle.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\FlowLayout.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\Joystick.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
     <ClCompile Include="src\ScriptController.cpp">
       <Filter>src</Filter>
     </ClCompile>
@@ -480,6 +618,9 @@
     <ClCompile Include="src\lua\lua_Gamepad.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
+    <ClCompile Include="src\Gamepad.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
     <ClCompile Include="src\ScreenDisplayer.cpp">
       <Filter>src</Filter>
     </ClCompile>
@@ -603,6 +744,12 @@
     <ClCompile Include="src\AIMessage.cpp">
       <Filter>src</Filter>
     </ClCompile>
+    <ClCompile Include="src\AIState.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\AIStateMachine.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
     <ClCompile Include="src\lua\lua_AIAgent.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
@@ -633,6 +780,9 @@
     <ClCompile Include="src\lua\lua_ScriptTarget.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
+    <ClCompile Include="src\gameplay-main-linux.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
     <ClCompile Include="src\PlatformLinux.cpp">
       <Filter>src</Filter>
     </ClCompile>
@@ -654,6 +804,12 @@
     <ClCompile Include="src\lua\lua_PhysicsVehicleWheel.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
+    <ClCompile Include="src\MathUtil.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
+    <ClCompile Include="src\Logger.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
     <ClCompile Include="src\lua\lua_LoggerLevel.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
@@ -678,12 +834,18 @@
     <ClCompile Include="src\lua\lua_RenderStateDepthFunction.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
+    <ClCompile Include="src\HeightField.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
     <ClCompile Include="src\lua\lua_HeightField.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
     <ClCompile Include="src\Platform.cpp">
       <Filter>src</Filter>
     </ClCompile>
+    <ClCompile Include="src\ImageControl.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
     <ClCompile Include="src\lua\lua_ImageControl.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
@@ -708,9 +870,6 @@
     <ClCompile Include="src\social\ScoreloopSocialSession.cpp">
       <Filter>src\social</Filter>
     </ClCompile>
-    <ClCompile Include="src\social\GoogleGamesSocialSession.cpp">
-      <Filter>src\social</Filter>
-    </ClCompile>
     <ClCompile Include="src\SocialAchievement.cpp">
       <Filter>src</Filter>
     </ClCompile>
@@ -726,179 +885,95 @@
     <ClCompile Include="src\SocialSessionListener.cpp">
       <Filter>src</Filter>
     </ClCompile>
-    <ClCompile Include="src\AIState.cpp">
-      <Filter>src</Filter>
+    <ClCompile Include="src\lua\lua_ControlAutoSize.cpp">
+      <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\AIStateMachine.cpp">
-      <Filter>src</Filter>
+    <ClCompile Include="src\lua\lua_FontFormat.cpp">
+      <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\Animation.cpp">
-      <Filter>src</Filter>
+    <ClCompile Include="src\lua\lua_RenderStateFrontFace.cpp">
+      <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\AnimationClip.cpp">
+    <ClCompile Include="src\SceneRenderer.cpp">
       <Filter>src</Filter>
     </ClCompile>
-    <ClCompile Include="src\AnimationController.cpp">
+    <ClCompile Include="src\SceneRendererForward.cpp">
       <Filter>src</Filter>
     </ClCompile>
-    <ClCompile Include="src\AnimationTarget.cpp">
+    <ClCompile Include="src\VisibleSetDefault.cpp">
       <Filter>src</Filter>
     </ClCompile>
-    <ClCompile Include="src\AnimationValue.cpp">
-      <Filter>src</Filter>
+    <ClCompile Include="src\social\GooglePlaySocialSession.cpp">
+      <Filter>src\social</Filter>
     </ClCompile>
-    <ClCompile Include="src\AudioBuffer.cpp">
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="src\Animation.h">
       <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\AudioController.cpp">
+    </ClInclude>
+    <ClInclude Include="src\AnimationClip.h">
       <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\AudioListener.cpp">
+    </ClInclude>
+    <ClInclude Include="src\AnimationController.h">
       <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\AudioSource.cpp">
+    </ClInclude>
+    <ClInclude Include="src\AnimationTarget.h">
       <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\BoundingBox.cpp">
+    </ClInclude>
+    <ClInclude Include="src\AnimationValue.h">
       <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\BoundingSphere.cpp">
+    </ClInclude>
+    <ClInclude Include="src\Base.h">
       <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Bundle.cpp">
+    </ClInclude>
+    <ClInclude Include="src\BoundingBox.h">
       <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Button.cpp">
+    </ClInclude>
+    <ClInclude Include="src\BoundingSphere.h">
       <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Camera.cpp">
+    </ClInclude>
+    <ClInclude Include="src\Camera.h">
       <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\CheckBox.cpp">
+    </ClInclude>
+    <ClInclude Include="src\Curve.h">
       <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Container.cpp">
+    </ClInclude>
+    <ClInclude Include="src\Effect.h">
       <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Control.cpp">
+    </ClInclude>
+    <ClInclude Include="src\FileSystem.h">
       <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Curve.cpp">
+    </ClInclude>
+    <ClInclude Include="src\Font.h">
       <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\DebugNew.cpp">
+    </ClInclude>
+    <ClInclude Include="src\Frustum.h">
       <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\DepthStencilTarget.cpp">
+    </ClInclude>
+    <ClInclude Include="src\Game.h">
       <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Effect.cpp">
+    </ClInclude>
+    <ClInclude Include="src\gameplay.h">
       <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\FileSystem.cpp">
+    </ClInclude>
+    <ClInclude Include="src\Light.h">
       <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\FlowLayout.cpp">
+    </ClInclude>
+    <ClInclude Include="src\Matrix.h">
       <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Font.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Form.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\FrameBuffer.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Frustum.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Game.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Gamepad.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\gameplay-main-android.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\gameplay-main-blackberry.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\gameplay-main-linux.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\gameplay-main-windows.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\HeightField.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Image.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\ImageControl.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Joint.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Joystick.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Label.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Layout.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Light.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Logger.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Material.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\MaterialParameter.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\MathUtil.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Matrix.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Mesh.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\MeshBatch.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\MeshPart.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\MeshSkin.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Model.cpp">
-      <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\Node.cpp">
+    </ClInclude>
+    <ClInclude Include="src\Mesh.h">
       <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\SceneRendererForward.cpp">
+    </ClInclude>
+    <ClInclude Include="src\MeshPart.h">
       <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\SceneRenderer.cpp">
+    </ClInclude>
+    <ClInclude Include="src\MeshSkin.h">
       <Filter>src</Filter>
-    </ClCompile>
-    <ClCompile Include="src\VisibleSetDefault.cpp">
+    </ClInclude>
+    <ClInclude Include="src\Model.h">
       <Filter>src</Filter>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
+    </ClInclude>
     <ClInclude Include="src\Node.h">
       <Filter>src</Filter>
     </ClInclude>
@@ -947,12 +1022,33 @@
     <ClInclude Include="src\VertexFormat.h">
       <Filter>src</Filter>
     </ClInclude>
+    <ClInclude Include="src\AudioController.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\AudioListener.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\AudioSource.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\AudioBuffer.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\MaterialParameter.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\Joint.h">
+      <Filter>src</Filter>
+    </ClInclude>
     <ClInclude Include="src\ParticleEmitter.h">
       <Filter>src</Filter>
     </ClInclude>
     <ClInclude Include="src\Properties.h">
       <Filter>src</Filter>
     </ClInclude>
+    <ClInclude Include="src\Material.h">
+      <Filter>src</Filter>
+    </ClInclude>
     <ClInclude Include="src\Technique.h">
       <Filter>src</Filter>
     </ClInclude>
@@ -962,6 +1058,9 @@
     <ClInclude Include="src\RenderState.h">
       <Filter>src</Filter>
     </ClInclude>
+    <ClInclude Include="src\DebugNew.h">
+      <Filter>src</Filter>
+    </ClInclude>
     <ClInclude Include="src\PhysicsController.h">
       <Filter>src</Filter>
     </ClInclude>
@@ -989,15 +1088,51 @@
     <ClInclude Include="src\SceneLoader.h">
       <Filter>src</Filter>
     </ClInclude>
+    <ClInclude Include="src\Image.h">
+      <Filter>src</Filter>
+    </ClInclude>
     <ClInclude Include="src\RenderTarget.h">
       <Filter>src</Filter>
     </ClInclude>
+    <ClInclude Include="src\FrameBuffer.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\DepthStencilTarget.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\Keyboard.h">
+      <Filter>src</Filter>
+    </ClInclude>
     <ClInclude Include="src\Touch.h">
       <Filter>src</Filter>
     </ClInclude>
+    <ClInclude Include="src\MeshBatch.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\Mouse.h">
+      <Filter>src</Filter>
+    </ClInclude>
     <ClInclude Include="src\AbsoluteLayout.h">
       <Filter>src</Filter>
     </ClInclude>
+    <ClInclude Include="src\Button.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\CheckBox.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\Container.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\Control.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\Label.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\Layout.h">
+      <Filter>src</Filter>
+    </ClInclude>
     <ClInclude Include="src\RadioButton.h">
       <Filter>src</Filter>
     </ClInclude>
@@ -1007,6 +1142,9 @@
     <ClInclude Include="src\VerticalLayout.h">
       <Filter>src</Filter>
     </ClInclude>
+    <ClInclude Include="src\Form.h">
+      <Filter>src</Filter>
+    </ClInclude>
     <ClInclude Include="src\Theme.h">
       <Filter>src</Filter>
     </ClInclude>
@@ -1034,6 +1172,18 @@
     <ClInclude Include="src\ThemeStyle.h">
       <Filter>src</Filter>
     </ClInclude>
+    <ClInclude Include="src\Bundle.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\FlowLayout.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\Joystick.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\MathUtil.h">
+      <Filter>src</Filter>
+    </ClInclude>
     <ClInclude Include="src\ScriptController.h">
       <Filter>src</Filter>
     </ClInclude>
@@ -1367,6 +1517,9 @@
     <ClInclude Include="src\lua\lua_Gamepad.h">
       <Filter>src\lua</Filter>
     </ClInclude>
+    <ClInclude Include="src\Gamepad.h">
+      <Filter>src</Filter>
+    </ClInclude>
     <ClInclude Include="src\lua\lua_AnimationClipListenerEventType.h">
       <Filter>src\lua</Filter>
     </ClInclude>
@@ -1478,12 +1631,21 @@
     <ClInclude Include="src\lua\lua_VertexFormatUsage.h">
       <Filter>src\lua</Filter>
     </ClInclude>
+    <ClInclude Include="src\AIStateMachine.h">
+      <Filter>src</Filter>
+    </ClInclude>
     <ClInclude Include="src\AIAgent.h">
       <Filter>src</Filter>
     </ClInclude>
     <ClInclude Include="src\AIController.h">
       <Filter>src</Filter>
     </ClInclude>
+    <ClInclude Include="src\AIMessage.h">
+      <Filter>src</Filter>
+    </ClInclude>
+    <ClInclude Include="src\AIState.h">
+      <Filter>src</Filter>
+    </ClInclude>
     <ClInclude Include="src\lua\lua_AIAgent.h">
       <Filter>src\lua</Filter>
     </ClInclude>
@@ -1514,6 +1676,9 @@
     <ClInclude Include="src\lua\lua_ScriptTarget.h">
       <Filter>src\lua</Filter>
     </ClInclude>
+    <ClInclude Include="src\Gesture.h">
+      <Filter>src</Filter>
+    </ClInclude>
     <ClInclude Include="src\lua\lua_Gesture.h">
       <Filter>src\lua</Filter>
     </ClInclude>
@@ -1532,6 +1697,9 @@
     <ClInclude Include="src\lua\lua_PhysicsVehicleWheel.h">
       <Filter>src\lua</Filter>
     </ClInclude>
+    <ClInclude Include="src\Logger.h">
+      <Filter>src</Filter>
+    </ClInclude>
     <ClInclude Include="src\lua\lua_Logger.h">
       <Filter>src\lua</Filter>
     </ClInclude>
@@ -1559,9 +1727,15 @@
     <ClInclude Include="src\lua\lua_RenderStateDepthFunction.h">
       <Filter>src\lua</Filter>
     </ClInclude>
+    <ClInclude Include="src\HeightField.h">
+      <Filter>src</Filter>
+    </ClInclude>
     <ClInclude Include="src\lua\lua_HeightField.h">
       <Filter>src\lua</Filter>
     </ClInclude>
+    <ClInclude Include="src\ImageControl.h">
+      <Filter>src</Filter>
+    </ClInclude>
     <ClInclude Include="src\lua\lua_ImageControl.h">
       <Filter>src\lua</Filter>
     </ClInclude>
@@ -1601,178 +1775,19 @@
     <ClInclude Include="src\social\ScoreloopSocialSession.h">
       <Filter>src\social</Filter>
     </ClInclude>
-    <ClInclude Include="src\social\GoogleGamesSocialSession.h">
-      <Filter>src\social</Filter>
-    </ClInclude>
     <ClInclude Include="src\SocialChallenge.h">
       <Filter>src</Filter>
     </ClInclude>
-    <ClInclude Include="src\SceneRenderer.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\AIMessage.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\AIState.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\AIStateMachine.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Animation.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\AnimationClip.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\AnimationController.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\AnimationTarget.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\AnimationValue.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\AudioBuffer.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\AudioController.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\AudioListener.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\AudioSource.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Base.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\BoundingBox.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\BoundingSphere.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Bundle.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Button.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Camera.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\CheckBox.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Container.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Control.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Curve.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\DebugNew.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\DepthStencilTarget.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Effect.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\FileSystem.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\FlowLayout.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Font.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Form.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\FrameBuffer.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Frustum.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Game.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Gamepad.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\gameplay.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Gesture.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\HeightField.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Image.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\ImageControl.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Joint.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Joystick.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Keyboard.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Label.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Layout.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Light.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Logger.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Material.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\MaterialParameter.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\MathUtil.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Matrix.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\Mesh.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\MeshBatch.h">
-      <Filter>src</Filter>
-    </ClInclude>
-    <ClInclude Include="src\MeshPart.h">
-      <Filter>src</Filter>
+    <ClInclude Include="src\lua\lua_ControlAutoSize.h">
+      <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\MeshSkin.h">
-      <Filter>src</Filter>
+    <ClInclude Include="src\lua\lua_FontFormat.h">
+      <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\Model.h">
-      <Filter>src</Filter>
+    <ClInclude Include="src\lua\lua_RenderStateFrontFace.h">
+      <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\Mouse.h">
+    <ClInclude Include="src\SceneRenderer.h">
       <Filter>src</Filter>
     </ClInclude>
     <ClInclude Include="src\SceneRendererForward.h">
@@ -1784,8 +1799,20 @@
     <ClInclude Include="src\VisibleSetDefault.h">
       <Filter>src</Filter>
     </ClInclude>
+    <ClInclude Include="src\social\GooglePlaySocialSession.h">
+      <Filter>src\social</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
+    <None Include="src\Game.inl">
+      <Filter>src</Filter>
+    </None>
+    <None Include="src\Image.inl">
+      <Filter>src</Filter>
+    </None>
+    <None Include="src\MeshBatch.inl">
+      <Filter>src</Filter>
+    </None>
     <None Include="res\logo_black.png">
       <Filter>res</Filter>
     </None>
@@ -1798,6 +1825,15 @@
     <None Include="res\logo_white.png">
       <Filter>res</Filter>
     </None>
+    <None Include="src\MathUtil.inl">
+      <Filter>src</Filter>
+    </None>
+    <None Include="src\MathUtilNeon.inl">
+      <Filter>src</Filter>
+    </None>
+    <None Include="src\Joystick.inl">
+      <Filter>src</Filter>
+    </None>
     <None Include="src\ScriptController.inl">
       <Filter>src</Filter>
     </None>
@@ -1882,44 +1918,26 @@
     <None Include="res\shaders\textured-unlit.vert">
       <Filter>res\shaders</Filter>
     </None>
-    <None Include="src\BoundingBox.inl">
-      <Filter>src</Filter>
-    </None>
-    <None Include="src\BoundingSphere.inl">
-      <Filter>src</Filter>
-    </None>
-    <None Include="src\Game.inl">
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="src\PhysicsFixedConstraint.inl">
       <Filter>src</Filter>
     </None>
-    <None Include="src\Image.inl">
+    <None Include="src\BoundingBox.inl">
       <Filter>src</Filter>
     </None>
-    <None Include="src\Joystick.inl">
+    <None Include="src\PhysicsGenericConstraint.inl">
       <Filter>src</Filter>
     </None>
-    <None Include="src\MathUtil.inl">
+    <None Include="src\BoundingSphere.inl">
       <Filter>src</Filter>
     </None>
-    <None Include="src\MathUtilNeon.inl">
+    <None Include="src\PhysicsSpringConstraint.inl">
       <Filter>src</Filter>
     </None>
     <None Include="src\Matrix.inl">
       <Filter>src</Filter>
     </None>
-    <None Include="src\MeshBatch.inl">
-      <Filter>src</Filter>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="src\PhysicsFixedConstraint.inl">
-      <Filter>src</Filter>
-    </None>
-    <None Include="src\PhysicsGenericConstraint.inl">
-      <Filter>src</Filter>
-    </None>
-    <None Include="src\PhysicsSpringConstraint.inl">
-      <Filter>src</Filter>
-    </None>
     <None Include="src\PhysicsRigidBody.inl">
       <Filter>src</Filter>
     </None>

+ 13 - 3
gameplay/src/CheckBox.cpp

@@ -145,11 +145,21 @@ void CheckBox::update(const Control* container, const Vector2& offset)
     {
         size.set(_imageSize);
     }
-    float iconWidth = size.x;
+    
+    if (_autoWidth == Control::AUTO_SIZE_FIT)
+    {
+        // Text-only width was already measured in Label::update - append image
+        setWidth(size.x + _bounds.width + 5);
+    }
 
-    _textBounds.x += iconWidth + 5;
-    _textBounds.width -= iconWidth + 5;
+    if (_autoHeight == Control::AUTO_SIZE_FIT)
+    {
+        // Text-only width was already measured in Label::update - append image
+        setHeight(std::max(getHeight(), size.y));
+    }
 
+    _textBounds.x += size.x + 5;
+    
     if (_checked)
     {
         _image = getImage("checked", _state);

+ 110 - 10
gameplay/src/Container.cpp

@@ -60,7 +60,7 @@ Container::Container()
       _lastFrameTime(0), _focusChangeRepeat(false),
       _focusChangeStartTime(0), _focusChangeRepeatDelay(FOCUS_CHANGE_REPEAT_DELAY), _focusChangeCount(0),
       _totalWidth(0), _totalHeight(0),
-      _initializedWithScroll(false), _scrollWheelRequiresFocus(false)
+      _initializedWithScroll(false), _scrollWheelRequiresFocus(false), _allowRelayout(true)
 {
 	clearContacts();
 }
@@ -100,6 +100,9 @@ Container* Container::create(Layout::Type type)
     case Layout::LAYOUT_VERTICAL:
         layout = VerticalLayout::create();
         break;
+    default:
+        layout = AbsoluteLayout::create();
+        break;
     }
 
     Container* container = new Container();
@@ -112,8 +115,28 @@ Container* Container::create(Theme::Style* style, Properties* properties, Theme*
 {
     GP_ASSERT(properties);
 
-    const char* layoutString = properties->getString("layout");
-    Container* container = Container::create(getLayoutType(layoutString));
+    // Parse layout
+    Container* container;
+    Properties* layoutNS = properties->getNamespace("layout", true, false);
+    if (layoutNS)
+    {
+        Layout::Type layoutType = getLayoutType(layoutNS->getString("type"));
+        container = Container::create(layoutType);
+        switch (layoutType)
+        {
+        case Layout::LAYOUT_FLOW:
+            static_cast<FlowLayout*>(container->getLayout())->setSpacing(layoutNS->getInt("horizontalSpacing"), layoutNS->getInt("verticalSpacing"));
+            break;
+        case Layout::LAYOUT_VERTICAL:
+            static_cast<VerticalLayout*>(container->getLayout())->setSpacing(layoutNS->getInt("spacing"));
+            break;
+        }
+    }
+    else
+    {
+        container = Container::create(getLayoutType(properties->getString("layout")));
+    }
+
     container->initialize(style, properties);
     container->_scroll = getScroll(properties->getString("scroll"));
     container->_scrollBarsAutoHide = properties->getBool("scrollBarsAutoHide");
@@ -469,6 +492,7 @@ void Container::update(const Control* container, const Vector2& offset)
 
         GP_ASSERT(_scrollBarLeftCap && _scrollBarHorizontal && _scrollBarRightCap);
 
+        _viewportBounds.height -= _scrollBarHorizontal->getRegion().height;
         _viewportClipBounds.height -= _scrollBarHorizontal->getRegion().height;
     }
 
@@ -479,7 +503,8 @@ void Container::update(const Control* container, const Vector2& offset)
         _scrollBarBottomCap = getImage("scrollBarBottomCap", _state);
 
         GP_ASSERT(_scrollBarTopCap && _scrollBarVertical && _scrollBarBottomCap);
-        
+
+        _viewportBounds.width -= _scrollBarVertical->getRegion().width;
         _viewportClipBounds.width -= _scrollBarVertical->getRegion().width;
     }
 
@@ -492,6 +517,81 @@ void Container::update(const Control* container, const Vector2& offset)
     {
         _layout->update(this, Vector2::zero());
     }
+
+    // Handle automatically sizing based on our children
+    if (_autoWidth == Control::AUTO_SIZE_FIT || _autoHeight == Control::AUTO_SIZE_FIT)
+    {
+        Vector2 oldSize(_bounds.width, _bounds.height);
+        bool sizeChanged = false;
+        bool relayout = false;
+
+        if (_autoWidth == Control::AUTO_SIZE_FIT)
+        {
+            // Size ourself to tightly fit the width of our children
+            float width = 0;
+            for (std::vector<Control*>::const_iterator it = _controls.begin(); it < _controls.end(); ++it)
+            {
+                Control* ctrl = *it;
+                if (ctrl->isXPercentage() || ctrl->isWidthPercentage())
+                {
+                    // We (this control's parent) are resizing and our child's layout
+                    // depends on our size, so we need to dirty it
+                    ctrl->_dirty = true;
+                    relayout = _allowRelayout;
+                }
+                else
+                {
+                    float w = ctrl->getX() + ctrl->getWidth();
+                    if (width < w)
+                        width = w;
+                }
+            }
+            width += getBorder(_state).left + getBorder(_state).right + getPadding().left + getPadding().right;
+            if (width != oldSize.x)
+            {
+                setWidth(width);
+                sizeChanged = true;
+            }
+        }
+
+        if (_autoHeight == Control::AUTO_SIZE_FIT)
+        {
+            // Size ourself to tightly fit the height of our children
+            float height = 0;
+            for (std::vector<Control*>::const_iterator it = _controls.begin(); it < _controls.end(); ++it)
+            {
+                Control* ctrl = *it;
+                if (ctrl->isYPercentage() || ctrl->isHeightPercentage())
+                {
+                    // We (this control's parent) are resizing and our child's layout
+                    // depends on our size, so we need to dirty it
+                    ctrl->_dirty = true;
+                    relayout = _allowRelayout;
+                }
+                else
+                {
+                    float h = ctrl->getY() + ctrl->getHeight();
+                    if (height < h)
+                        height = h;
+                }
+            }
+            height += getBorder(_state).top + getBorder(_state).bottom + getPadding().top + getPadding().bottom;
+            if (height != oldSize.y)
+            {
+                setHeight(height);
+                sizeChanged = true;
+            }
+        }
+
+        if (sizeChanged && relayout)
+        {
+            // Our size changed and as a result we need to force another layout.
+            // Prevent infinitely recursive layouts by disabling relayout for the next call.
+            _allowRelayout = false;
+            update(container, offset);
+            _allowRelayout = true;
+        }
+    }
 }
 
 void Container::draw(SpriteBatch* spriteBatch, const Rectangle& clip, bool needsClear, bool cleared, float targetHeight)
@@ -560,7 +660,7 @@ void Container::draw(SpriteBatch* spriteBatch, const Rectangle& clip, bool needs
 
             clipRegion.width += verticalRegion.width;
 
-            Rectangle bounds(_viewportBounds.x + _viewportBounds.width - verticalRegion.width, _viewportBounds.y + _scrollBarBounds.y, topRegion.width, topRegion.height);
+            Rectangle bounds(_viewportBounds.x + _viewportBounds.width, _viewportBounds.y + _scrollBarBounds.y, topRegion.width, topRegion.height);
             spriteBatch->draw(bounds.x, bounds.y, bounds.width, bounds.height, topUVs.u1, topUVs.v1, topUVs.u2, topUVs.v2, topColor, clipRegion);
 
             bounds.y += topRegion.height;
@@ -591,7 +691,7 @@ void Container::draw(SpriteBatch* spriteBatch, const Rectangle& clip, bool needs
 
             clipRegion.height += horizontalRegion.height;
         
-            Rectangle bounds(_viewportBounds.x + _scrollBarBounds.x, _viewportBounds.y + _viewportBounds.height - horizontalRegion.height, leftRegion.width, leftRegion.height);
+            Rectangle bounds(_viewportBounds.x + _scrollBarBounds.x, _viewportBounds.y + _viewportBounds.height, leftRegion.width, leftRegion.height);
             spriteBatch->draw(bounds.x, bounds.y, bounds.width, bounds.height, leftUVs.u1, leftUVs.v1, leftUVs.u2, leftUVs.v2, leftColor, clipRegion);
 
             bounds.x += leftRegion.width;
@@ -1337,8 +1437,8 @@ void Container::updateScroll()
 
     float vWidth = getImageRegion("verticalScrollBar", _state).width;
     float hHeight = getImageRegion("horizontalScrollBar", _state).height;
-    float clipWidth = _bounds.width - containerBorder.left - containerBorder.right - containerPadding.left - containerPadding.right - vWidth;
-    float clipHeight = _bounds.height - containerBorder.top - containerBorder.bottom - containerPadding.top - containerPadding.bottom - hHeight;
+    float clipWidth = _absoluteBounds.width - containerBorder.left - containerBorder.right - containerPadding.left - containerPadding.right - vWidth;
+    float clipHeight = _absoluteBounds.height - containerBorder.top - containerBorder.bottom - containerPadding.top - containerPadding.bottom - hHeight;
 
     // Apply and dampen inertia.
     if (!_scrollingVelocity.isZero())
@@ -1577,7 +1677,7 @@ bool Container::mouseEventScroll(Mouse::MouseEvent evt, int x, int y, int wheelD
             if (_scrollBarVertical)
             {
                 float vWidth = _scrollBarVertical->getRegion().width;
-                Rectangle vBounds(_viewportBounds.x + _viewportBounds.width - vWidth,
+                Rectangle vBounds(_viewportBounds.x + _viewportBounds.width,
                                  _scrollBarBounds.y,
                                  vWidth, _scrollBarBounds.height);
 
@@ -1605,7 +1705,7 @@ bool Container::mouseEventScroll(Mouse::MouseEvent evt, int x, int y, int wheelD
             {
                 float hHeight = _scrollBarHorizontal->getRegion().height;
                 Rectangle hBounds(_scrollBarBounds.x,
-                                  _viewportBounds.y + _viewportBounds.height - hHeight,
+                                  _viewportBounds.y + _viewportBounds.height,
                                   _scrollBarBounds.width, hHeight);
             
                 if (y + _viewportBounds.y >= hBounds.y &&

+ 1 - 0
gameplay/src/Container.h

@@ -631,6 +631,7 @@ private:
     bool _contactIndices[MAX_CONTACT_INDICES];
     bool _initializedWithScroll;
     bool _scrollWheelRequiresFocus;
+    bool _allowRelayout;
 };
 
 }

+ 287 - 121
gameplay/src/Control.cpp

@@ -2,12 +2,50 @@
 #include "Game.h"
 #include "Control.h"
 
+#define BOUNDS_X_PERCENTAGE_BIT 1
+#define BOUNDS_Y_PERCENTAGE_BIT 2
+#define BOUNDS_WIDTH_PERCENTAGE_BIT 4
+#define BOUNDS_HEIGHT_PERCENTAGE_BIT 8
+
 namespace gameplay
 {
 
+static std::string toString(float v)
+{
+    std::ostringstream s;
+    s << v;
+    return s.str();
+}
+
+static float parseCoord(const char* s, bool* isPercentage)
+{
+    const char* p;
+    if ((p = strchr(s, '%')) != NULL)
+    {
+        std::string value(s, (std::string::size_type)(p - s));
+        *isPercentage = true;
+        return (float)(atof(value.c_str()) * 0.01);
+    }
+    *isPercentage = false;
+    return (float)atof(s);
+}
+
+static bool parseCoordPair(const char* s, float* v1, float* v2, bool* v1Percentage, bool* v2Percentage)
+{
+    size_t len = strlen(s);
+    const char* s2 = strchr(s, ',');
+    if (s2 == NULL)
+        return false;
+    std::string v1Str(s, (std::string::size_type)(s2 - s));
+    std::string v2Str(s2 + 1);
+    *v1 = parseCoord(v1Str.c_str(), v1Percentage);
+    *v2 = parseCoord(v2Str.c_str(), v2Percentage);
+    return true;
+}
+
 Control::Control()
-    : _id(""), _state(Control::NORMAL), _bounds(Rectangle::empty()), _clipBounds(Rectangle::empty()), _viewportClipBounds(Rectangle::empty()),
-    _clearBounds(Rectangle::empty()), _dirty(true), _consumeInputEvents(false), _alignment(ALIGN_TOP_LEFT), _isAlignmentSet(false), _autoWidth(false), _autoHeight(false), _listeners(NULL), _visible(true),
+    : _id(""), _state(Control::NORMAL), _boundsBits(0), _dirty(true), _consumeInputEvents(false),
+    _alignment(ALIGN_TOP_LEFT), _isAlignmentSet(false), _autoWidth(AUTO_SIZE_NONE), _autoHeight(AUTO_SIZE_NONE), _listeners(NULL), _visible(true),
     _zIndex(-1), _contactIndex(INVALID_CONTACT_INDEX), _focusIndex(-1), _parent(NULL), _styleOverridden(false), _skin(NULL), _previousState(NORMAL)
 {
     addScriptEvent("controlEvent", "<Control>[Control::Listener::EventType]");
@@ -31,6 +69,17 @@ Control::~Control()
     }
 }
 
+static Control::AutoSize parseAutoSize(const char* str)
+{
+    if (str == NULL)
+        return Control::AUTO_SIZE_NONE;
+    if (strcmp(str, "AUTO_SIZE_STRETCH") == 0 || strcmp(str, "true") == 0) // left for backwards compatibility
+        return Control::AUTO_SIZE_STRETCH;
+    if (strcmp(str, "AUTO_SIZE_FIT") == 0)
+        return Control::AUTO_SIZE_FIT;
+    return Control::AUTO_SIZE_NONE;
+}
+
 void Control::initialize(Theme::Style* style, Properties* properties)
 {
     GP_ASSERT(properties);
@@ -41,8 +90,9 @@ void Control::initialize(Theme::Style* style, Properties* properties)
 
     _isAlignmentSet = alignmentString != NULL;
     _alignment = getAlignment(alignmentString);
-    _autoWidth = properties->getBool("autoWidth");
-    _autoHeight = properties->getBool("autoHeight");
+
+    _autoWidth = parseAutoSize(properties->getString("autoWidth"));
+    _autoHeight = parseAutoSize(properties->getString("autoHeight"));
 
     _consumeInputEvents = properties->getBool("consumeInputEvents", false);
 
@@ -66,28 +116,31 @@ void Control::initialize(Theme::Style* style, Properties* properties)
         _focusIndex = -1;
     }
 
-    Vector2 position;
-    Vector2 size;
+    float bounds[4];
+    bool boundsBits[4];
     if (properties->exists("position"))
     {
-        properties->getVector2("position", &position);
+        parseCoordPair(properties->getString("position", "0,0"), &bounds[0], &bounds[1], &boundsBits[0], &boundsBits[1]);
     }
     else
     {
-        position.x = properties->getFloat("x");
-        position.y = properties->getFloat("y");
+        bounds[0] = parseCoord(properties->getString("x", "0"), &boundsBits[0]);
+        bounds[1] = parseCoord(properties->getString("y", "0"), &boundsBits[1]);
     }
-        
+
     if (properties->exists("size"))
     {
-        properties->getVector2("size", &size);
+        parseCoordPair(properties->getString("size", "0,0"), &bounds[2], &bounds[3], &boundsBits[2], &boundsBits[3]);
     }
     else
     {
-        size.x = properties->getFloat("width");
-        size.y = properties->getFloat("height");
+        bounds[2] = parseCoord(properties->getString("width", "0"), &boundsBits[2]);
+        bounds[3] = parseCoord(properties->getString("height", "0"), &boundsBits[3]);
     }
-    setBounds(Rectangle(position.x, position.y, size.x, size.y));
+    setX(bounds[0], boundsBits[0]);
+    setY(bounds[1], boundsBits[1]);
+    setWidth(bounds[2], boundsBits[2]);
+    setHeight(bounds[3], boundsBits[3]);
 
     const char* id = properties->getId();
     if (id)
@@ -98,6 +151,10 @@ void Control::initialize(Theme::Style* style, Properties* properties)
         setEnabled(properties->getBool("enabled"));
     }
 
+    // Register script listeners for control events
+    if (properties->exists("listener"))
+        addScriptCallback("controlEvent", properties->getString("listener"));
+
     // Potentially override themed properties for all states.
     overrideThemedProperties(properties, STATE_ALL);
 
@@ -147,81 +204,156 @@ const char* Control::getId() const
     return _id.c_str();
 }
 
-void Control::setPosition(float x, float y)
+float Control::getX() const
 {
-    if (x != _bounds.x || y != _bounds.y)
-    {
-        _bounds.x = x;
-        _bounds.y = y;
-        _dirty = true;
-    }
+    return _bounds.x;
 }
 
-void Control::setSize(float width, float height)
+void Control::setX(float x, bool percentage)
 {
-    if (width != _bounds.width || height != _bounds.height)
+    if (_relativeBounds.x != x || percentage != ((_boundsBits & BOUNDS_X_PERCENTAGE_BIT) != 0))
     {
-        _bounds.width = width;
-        _bounds.height = height;
+        _relativeBounds.x = x;
+        if (percentage)
+        {
+            _boundsBits |= BOUNDS_X_PERCENTAGE_BIT;
+        }
+        else
+        {
+            _boundsBits &= ~BOUNDS_X_PERCENTAGE_BIT;
+            _bounds.x = x;
+        }
         _dirty = true;
     }
 }
 
-void Control::setWidth(float width)
+bool Control::isXPercentage() const
 {
-    if (width != _bounds.width)
+    return (_boundsBits & BOUNDS_X_PERCENTAGE_BIT) != 0;
+}
+
+float Control::getY() const
+{
+    return _bounds.y;
+}
+
+void Control::setY(float y, bool percentage)
+{
+    if (_relativeBounds.y != y || percentage != ((_boundsBits & BOUNDS_Y_PERCENTAGE_BIT) != 0))
     {
-        _bounds.width = width;
+        _relativeBounds.y = y;
+        if (percentage)
+        {
+            _boundsBits |= BOUNDS_Y_PERCENTAGE_BIT;
+        }
+        else
+        {
+            _boundsBits &= ~BOUNDS_Y_PERCENTAGE_BIT;
+            _bounds.y = y;
+        }
         _dirty = true;
     }
 }
 
-void Control::setHeight(float height)
+bool Control::isYPercentage() const
+{
+    return (_boundsBits & BOUNDS_Y_PERCENTAGE_BIT) != 0;
+}
+
+float Control::getWidth() const
+{
+    return _bounds.width;
+}
+
+void Control::setWidth(float width, bool percentage)
 {
-    if (height != _bounds.height)
+    if (_relativeBounds.width != width || percentage != ((_boundsBits & BOUNDS_WIDTH_PERCENTAGE_BIT) != 0))
     {
-        _bounds.height = height;
+        _relativeBounds.width = width;
+        if (percentage)
+        {
+            _boundsBits |= BOUNDS_WIDTH_PERCENTAGE_BIT;
+        }
+        else
+        {
+            _boundsBits &= ~BOUNDS_WIDTH_PERCENTAGE_BIT;
+            _bounds.width = width;
+        }
         _dirty = true;
     }
 }
 
-void Control::setBounds(const Rectangle& bounds)
+bool Control::isWidthPercentage() const
 {
-    if (bounds != _bounds)
+    return (_boundsBits & BOUNDS_WIDTH_PERCENTAGE_BIT) != 0;
+}
+
+float Control::getHeight() const
+{
+    return _bounds.height;
+}
+
+void Control::setHeight(float height, bool percentage)
+{
+    if (_relativeBounds.height != height || percentage != ((_boundsBits & BOUNDS_HEIGHT_PERCENTAGE_BIT) != 0))
     {
-        _bounds.set(bounds);
+        _relativeBounds.height = height;
+        if (percentage)
+        {
+            _boundsBits |= BOUNDS_HEIGHT_PERCENTAGE_BIT;
+        }
+        else
+        {
+            _boundsBits &= ~BOUNDS_HEIGHT_PERCENTAGE_BIT;
+            _bounds.height = height;
+        }
         _dirty = true;
     }
 }
 
-const Rectangle& Control::getBounds() const
+bool Control::isHeightPercentage() const
 {
-    return _bounds;
+    return (_boundsBits & BOUNDS_HEIGHT_PERCENTAGE_BIT) != 0;
 }
 
-const Rectangle& Control::getAbsoluteBounds() const
+void Control::setPosition(float x, float y)
 {
-    return _absoluteBounds;
+    setX(x);
+    setY(y);
 }
 
-float Control::getX() const
+void Control::setSize(float width, float height)
 {
-    return _bounds.x;
+    setWidth(width);
+    setHeight(height);
 }
 
-float Control::getY() const
+const Rectangle& Control::getBounds() const
 {
-    return _bounds.y;
+    return _bounds;
 }
 
-float Control::getWidth() const
+void Control::setBounds(const Rectangle& bounds)
 {
-    return _bounds.width;
+    setX(bounds.x);
+    setY(bounds.y);
+    setWidth(bounds.width);
+    setHeight(bounds.height);
 }
 
-float Control::getHeight() const
+const Rectangle& Control::getAbsoluteBounds() const
 {
-    return _bounds.height;
+    return _absoluteBounds;
+}
+
+const Rectangle& Control::getClipBounds() const
+{
+    return _clipBounds;
+}
+
+const Rectangle& Control::getClip() const
+{
+    return _viewportClipBounds;
 }
 
 void Control::setAlignment(Alignment alignment)
@@ -236,32 +368,42 @@ Control::Alignment Control::getAlignment() const
     return _alignment;
 }
 
+Control::AutoSize Control::getAutoWidth() const
+{
+    return _autoWidth;
+}
+
 void Control::setAutoWidth(bool autoWidth)
 {
-    if (_autoWidth != autoWidth)
+    setAutoWidth(autoWidth ? AUTO_SIZE_STRETCH : AUTO_SIZE_NONE);
+}
+
+void Control::setAutoWidth(AutoSize mode)
+{
+    if (_autoWidth != mode)
     {
-        _autoWidth = autoWidth;
+        _autoWidth = mode;
         _dirty = true;
     }
 }
 
-bool Control::getAutoWidth() const
+Control::AutoSize Control::getAutoHeight() const
 {
-    return _autoWidth;
+    return _autoHeight;
 }
 
 void Control::setAutoHeight(bool autoHeight)
 {
-    if (_autoHeight != autoHeight)
-    {
-        _autoHeight = autoHeight;
-        _dirty = true;
-    }
+    setAutoHeight(autoHeight ? AUTO_SIZE_STRETCH : AUTO_SIZE_NONE);
 }
 
-bool Control::getAutoHeight() const
+void Control::setAutoHeight(AutoSize mode)
 {
-    return _autoHeight;
+    if (_autoHeight != mode)
+    {
+        _autoHeight = mode;
+        _dirty = true;
+    }
 }
 
 void Control::setVisible(bool visible)
@@ -633,16 +775,6 @@ bool Control::getTextRightToLeft(State state) const
     return overlay->getTextRightToLeft();
 }
 
-const Rectangle& Control::getClipBounds() const
-{
-    return _clipBounds;
-}
-
-const Rectangle& Control::getClip() const
-{
-    return _viewportClipBounds;
-}
-
 void Control::setStyle(Theme::Style* style)
 {
     if (style != _style)
@@ -956,24 +1088,51 @@ void Control::notifyListeners(Control::Listener::EventType eventType)
 
 void Control::update(const Control* container, const Vector2& offset)
 {
-    const Rectangle& clip = container->getClip();
-    const Rectangle& absoluteViewport = container->_viewportBounds;
+    Game* game = Game::getInstance();
+    const Rectangle parentAbsoluteBounds = container ? container->_viewportBounds : Rectangle(0, 0, game->getViewport().width, game->getViewport().height);
+    const Rectangle parentAbsoluteClip = container ? container->getClip() : parentAbsoluteBounds;
 
+    // Store previous absolute clip bounds
     _clearBounds.set(_absoluteClipBounds);
 
-    // Calculate the clipped bounds.
-    float x = _bounds.x + offset.x;
-    float y = _bounds.y + offset.y;
-    float width = _bounds.width;
-    float height = _bounds.height;
-
-    float clipX2 = clip.x + clip.width;
-    float x2 = clip.x + x + width;
+    // Calculate local un-clipped bounds.
+    _bounds.set(_relativeBounds);
+    if (isXPercentage())
+        _bounds.x *= parentAbsoluteBounds.width;
+    if (isYPercentage())
+        _bounds.y *= parentAbsoluteBounds.height;
+    if (_autoWidth == AUTO_SIZE_STRETCH)
+        _bounds.width = parentAbsoluteBounds.width;
+    else if (isWidthPercentage())
+        _bounds.width *= parentAbsoluteBounds.width;
+    if (_autoHeight == AUTO_SIZE_STRETCH)
+        _bounds.height = parentAbsoluteBounds.height;
+    else if (isHeightPercentage())
+        _bounds.height *= parentAbsoluteBounds.height;
+
+    float x, y, width, height, clipX2, x2, clipY2, y2;
+
+    // Calculate the local clipped bounds
+    width = _bounds.width;
+    height = _bounds.height;
+    if (container)
+    {
+        x = _bounds.x + offset.x;
+        y = _bounds.y + offset.y;
+        x2 = parentAbsoluteClip.x + x + width;
+        y2 = parentAbsoluteClip.y + y + height;
+    }
+    else
+    {
+        x = 0;
+        y = 0;
+        x2 = width;
+        y2 = height;
+    }
+    clipX2 = parentAbsoluteClip.x + parentAbsoluteClip.width;
+    clipY2 = parentAbsoluteClip.y + parentAbsoluteClip.height;
     if (x2 > clipX2)
         width -= x2 - clipX2;
-
-    float clipY2 = clip.y + clip.height;
-    float y2 = clip.y + y + height;
     if (y2 > clipY2)
         height -= y2 - clipY2;
 
@@ -999,50 +1158,63 @@ void Control::update(const Control* container, const Vector2& offset)
 
     _clipBounds.set(x, y, width, height);
 
-    // Calculate the absolute bounds.
-    x = _bounds.x + offset.x + absoluteViewport.x;
-    y = _bounds.y + offset.y + absoluteViewport.y;
+    // Calculate absolute bounds un-clipped bounds
+    if (container)
+    {
+        x = _bounds.x + offset.x + parentAbsoluteBounds.x;
+        y = _bounds.y + offset.y + parentAbsoluteBounds.y;
+    }
+    else
+    {
+        x = 0;
+        y = 0;
+    }
     _absoluteBounds.set(x, y, _bounds.width, _bounds.height);
 
-    // Calculate the absolute viewport bounds.
+    // Calculate the absolute viewport bounds (content area, which does not include border and padding)
     // Absolute bounds minus border and padding.
     const Theme::Border& border = getBorder(_state);
     const Theme::Padding& padding = getPadding();
-
     x += border.left + padding.left;
     y += border.top + padding.top;
     width = _bounds.width - border.left - padding.left - border.right - padding.right;
     height = _bounds.height - border.top - padding.top - border.bottom - padding.bottom;
-
     _viewportBounds.set(x, y, width, height);
 
     // Calculate the clip area.
     // Absolute bounds, minus border and padding,
     // clipped to the parent container's clip area.
-    clipX2 = clip.x + clip.width;
+    if (container)
+    {
+        clipX2 = parentAbsoluteClip.x + parentAbsoluteClip.width;
+        clipY2 = parentAbsoluteClip.y + parentAbsoluteClip.height;
+    }
+    else
+    {
+        clipX2 = parentAbsoluteClip.width;
+        clipY2 = parentAbsoluteClip.height;
+    }
     x2 = x + width;
     if (x2 > clipX2)
         width = clipX2 - x;
-
-    clipY2 = clip.y + clip.height;
     y2 = y + height;
     if (y2 > clipY2)
         height = clipY2 - y;
 
-    if (x < clip.x)
+    if (x < parentAbsoluteClip.x)
     {
-        float dx = clip.x - x;
+        float dx = parentAbsoluteClip.x - x;
         width -= dx;
-        x = clip.x;
+        x = parentAbsoluteClip.x;
     }
 
-    if (y < clip.y)
+    if (y < parentAbsoluteClip.y)
     {
-        float dy = clip.y - y;
+        float dy = parentAbsoluteClip.y - y;
         height -= dy;
-        y = clip.y;
+        y = parentAbsoluteClip.y;
     }
- 
+
     _viewportClipBounds.set(x, y, width, height);
 
     width += border.left + padding.left + border.right + padding.right;
@@ -1057,12 +1229,14 @@ void Control::update(const Control* container, const Vector2& offset)
     _skin = getSkin(_state);
 
     // Current opacity should be multiplied by that of the parent container.
-    _opacity = getOpacity(_state) * container->_opacity;
+    _opacity = getOpacity(_state);
+    if (container)
+        _opacity *= container->_opacity;
 }
 
 void Control::drawBorder(SpriteBatch* spriteBatch, const Rectangle& clip)
 {
-    if (!spriteBatch || !_skin || _bounds.width <= 0 || _bounds.height <= 0)
+    if (!spriteBatch || !_skin || _absoluteBounds.width <= 0 || _absoluteBounds.height <= 0)
         return;
 
     // Get the border and background images for this control's current state.
@@ -1082,18 +1256,18 @@ void Control::drawBorder(SpriteBatch* spriteBatch, const Rectangle& clip)
     Vector4 skinColor = _skin->getColor();
     skinColor.w *= _opacity;
 
-    float midWidth = _bounds.width - border.left - border.right;
-    float midHeight = _bounds.height - border.top - border.bottom;
+    float midWidth = _absoluteBounds.width - border.left - border.right;
+    float midHeight = _absoluteBounds.height - border.top - border.bottom;
     float midX = _absoluteBounds.x + border.left;
     float midY = _absoluteBounds.y + border.top;
-    float rightX = _absoluteBounds.x + _bounds.width - border.right;
-    float bottomY = _absoluteBounds.y + _bounds.height - border.bottom;
+    float rightX = _absoluteBounds.x + _absoluteBounds.width - border.right;
+    float bottomY = _absoluteBounds.y + _absoluteBounds.height - border.bottom;
 
     // Draw themed border sprites.
     if (!border.left && !border.right && !border.top && !border.bottom)
     {
         // No border, just draw the image.
-        spriteBatch->draw(_absoluteBounds.x, _absoluteBounds.y, _bounds.width, _bounds.height, center.u1, center.v1, center.u2, center.v2, skinColor, clip);
+        spriteBatch->draw(_absoluteBounds.x, _absoluteBounds.y, _absoluteBounds.width, _absoluteBounds.height, center.u1, center.v1, center.u2, center.v2, skinColor, clip);
     }
     else
     {
@@ -1107,7 +1281,7 @@ void Control::drawBorder(SpriteBatch* spriteBatch, const Rectangle& clip)
             spriteBatch->draw(_absoluteBounds.x, midY, border.left, midHeight, left.u1, left.v1, left.u2, left.v2, skinColor, clip);
 
         // Always draw the background.
-        spriteBatch->draw(_absoluteBounds.x + border.left, _absoluteBounds.y + border.top, _bounds.width - border.left - border.right, _bounds.height - border.top - border.bottom,
+        spriteBatch->draw(_absoluteBounds.x + border.left, _absoluteBounds.y + border.top, _absoluteBounds.width - border.left - border.right, _absoluteBounds.height - border.top - border.bottom,
             center.u1, center.v1, center.u2, center.v2, skinColor, clip);
 
         if (border.right)
@@ -1237,7 +1411,7 @@ void Control::getAnimationPropertyValue(int propertyId, AnimationValue* value)
 {
     GP_ASSERT(value);
 
-    switch(propertyId)
+    switch (propertyId)
     {
     case ANIMATE_POSITION:
         value->setFloat(0, _bounds.x);
@@ -1274,38 +1448,30 @@ void Control::setAnimationPropertyValue(int propertyId, AnimationValue* value, f
     switch(propertyId)
     {
     case ANIMATE_POSITION:
-        _bounds.x = Curve::lerp(blendWeight, _bounds.x, value->getFloat(0));
-        _bounds.y = Curve::lerp(blendWeight, _bounds.y, value->getFloat(1));
-        _dirty = true;
+        setX(Curve::lerp(blendWeight, _bounds.x, value->getFloat(0)), isXPercentage());
+        setY(Curve::lerp(blendWeight, _bounds.y, value->getFloat(1)), isYPercentage());
         break;
     case ANIMATE_POSITION_X:
-        _bounds.x = Curve::lerp(blendWeight, _bounds.x, value->getFloat(0));
-        _dirty = true;
+        setX(Curve::lerp(blendWeight, _bounds.x, value->getFloat(0)), isXPercentage());
         break;
     case ANIMATE_POSITION_Y:
-        _bounds.y = Curve::lerp(blendWeight, _bounds.y, value->getFloat(0));
-        _dirty = true;
+        setY(Curve::lerp(blendWeight, _bounds.y, value->getFloat(0)), isYPercentage());
         break;
     case ANIMATE_SIZE:
-        _bounds.width = Curve::lerp(blendWeight, _bounds.width, value->getFloat(0));
-        _bounds.height = Curve::lerp(blendWeight, _bounds.height, value->getFloat(1));
-        _dirty = true;
+        setWidth(Curve::lerp(blendWeight, _bounds.width, value->getFloat(0)), isWidthPercentage());
+        setHeight(Curve::lerp(blendWeight, _bounds.height, value->getFloat(1)), isHeightPercentage());
         break;
     case ANIMATE_SIZE_WIDTH:
-        _bounds.width = Curve::lerp(blendWeight, _bounds.width, value->getFloat(0));
-        _dirty = true;
+        setWidth(Curve::lerp(blendWeight, _bounds.width, value->getFloat(0)), isWidthPercentage());
         break;
     case ANIMATE_SIZE_HEIGHT:
-        _bounds.height = Curve::lerp(blendWeight, _bounds.height, value->getFloat(0));
-        _dirty = true;
+        setHeight(Curve::lerp(blendWeight, _bounds.height, value->getFloat(0)), isHeightPercentage());
         break;
     case ANIMATE_OPACITY:
         setOpacity(Curve::lerp(blendWeight, _opacity, value->getFloat(0)));
-        _dirty = true;
         break;
     }
 }
-    
 
 Theme::Style::Overlay** Control::getOverlays(unsigned char overlayTypes, Theme::Style::Overlay** overlays)
 {

+ 193 - 67
gameplay/src/Control.h

@@ -91,6 +91,29 @@ public:
         ALIGN_BOTTOM_RIGHT = ALIGN_BOTTOM | ALIGN_RIGHT
     };
 
+    /**
+     * Defines supported auto sizing modes for controls.
+     */
+    enum AutoSize
+    {
+        /**
+         * No auto sizing is applied.
+         */
+        AUTO_SIZE_NONE = 0x00,
+
+        /**
+         * The control's size is stretched to fill the content area of its parent container.
+         */
+        AUTO_SIZE_STRETCH = 0x01,
+
+        /**
+         * The control's size is set to tightly fit its contents.
+         *
+         * Not all controls support this auto sizing mode.
+         */
+        AUTO_SIZE_FIT = 0x02
+    };
+
     /**
      * Implement Control::Listener and call Control::addListener()
      * in order to listen for events on controls.
@@ -215,42 +238,128 @@ public:
     const char* getId() const;
 
     /**
-     * Set the position of this control relative to its parent container.
+     * Get the x coordinate of this control.
      *
-     * @param x The x coordinate.
-     * @param y The y coordinate.
+     * @return The x coordinate of this control.
      */
-    void setPosition(float x, float y);
+    float getX() const;
 
     /**
-     * Set the desired size of this control, including its border and padding, before clipping.
+     * Sets the X coordinate for the control.
      *
-     * @param width The width.
-     * @param height The height.
+     * If the value is passed as a percentage of its parent container's clip region, it is interpreted as a value
+     * between 0-1, where 1 equals the full size of it's parent.
+     *
+     * @param x The new X coordinate.
+     * @param percentage True if the value should be interpreted as a percentage (0-1), false if it is regular number.
      */
-    virtual void setSize(float width, float height);
+    void setX(float x, bool percentage = false);
 
-    /** 
+    /**
+     * Determines if the X coordinate of this control computed as a percentage of its parent container.
+     *
+     * @return True if the X value is computed as a percentage of its parent container.
+     */
+    bool isXPercentage() const;
+
+    /**
+     * Get the y coordinate of this control.
+     *
+     * @return The y coordinate of this control.
+     */
+    float getY() const;
+
+    /**
+     * Sets the Y coordinate for the control.
+     *
+     * If the value is passed as a percentage of its parent container's clip region, it is interpreted as a value
+     * between 0-1, where 1 equals the full size of it's parent.
+     *
+     * @param y The new Y coordinate.
+     * @param percentage True if the value should be interpreted as a percentage (0-1), false if it is regular number.
+     */
+    void setY(float y, bool percentage = false);
+
+    /**
+     * Determines if the Y coordinate of this control is computed as a percentage of its parent container.
+     *
+     * @return True if the Y value is computed as a percentage of its parent container.
+     */
+    bool isYPercentage() const;
+
+    /**
+     * Get the width of this control.
+     *
+     * @return The width of this control.
+     */
+    float getWidth() const;
+
+    /**
      * Set the desired width of the control, including it's border and padding, before clipping.
      *
+     * If the value is passed as a percentage of its parent container's clip region, it is interpreted as a value
+     * between 0-1, where 1 equals the full size of it's parent.
+     *
      * @param width The width.
+     * @param percentage True if the value should be interpreted as a percentage (0-1), false if it is regular number.
      */
-    virtual void setWidth(float width);
+    void setWidth(float width, bool percentage = false);
 
-    /** 
+    /**
+     * Determines if the width of this control is computed as a percentage of its parent container.
+     *
+     * @return True if the width is computed as a percentage of its parent container.
+     */
+    bool isWidthPercentage() const;
+
+    /**
+     * Get the height of this control.
+     *
+     * @return The height of this control.
+     */
+    float getHeight() const;
+
+    /**
      * Set the desired height of the control, including it's border and padding, before clipping.
      *
+     * If the value is passed as a percentage of its parent container's clip region, it is interpreted as a value
+     * between 0-1, where 1 equals the full size of it's parent.
+     *
      * @param height The height.
+     * @param percentage True if the value should be interpreted as a percentage (0-1), false if it is regular number.
      */
-    virtual void setHeight(float height);
+    void setHeight(float height, bool percentage = false);
 
     /**
-     * Set the bounds of this control, relative to its parent container and including its
-     * border and padding, before clipping.
+     * Determines if the height of this control is computed as a percentage of its parent container.
      *
-     * @param bounds The new bounds to set.
+     * @return True if the height is computed as a percentage of its parent container.
      */
-    virtual void setBounds(const Rectangle& bounds);
+    bool isHeightPercentage() const;
+
+    /**
+     * Set the position of this control relative to its parent container.
+     *
+     * This method sets the local position of the control, relative to its container.
+     * Setting percetage values is not supported with this method, use setX
+     * and setY instead.
+     *
+     * @param x The x coordinate.
+     * @param y The y coordinate.
+     */
+    void setPosition(float x, float y);
+
+    /**
+     * Set the desired size of this control, including its border and padding, before clipping.
+     *
+     * This method sets the size of the control, relative to its container.
+     * Setting percetage values is not supported with this method, use setWidth
+     * and setHeight instead.
+     *
+     * @param width The width.
+     * @param height The height.
+     */
+    void setSize(float width, float height);
 
     /**
      * Get the bounds of this control, relative to its parent container and including its
@@ -260,85 +369,106 @@ public:
      */
     const Rectangle& getBounds() const;
 
+    /**
+     * Set the bounds of this control, relative to its parent container and including its
+     * border and padding, before clipping.
+     *
+     * This method sets the local bounds of the control, relative to its container.
+     * Setting percetage values is not supported with this method, use setX,
+     * setY, setWidth and setHeight instead.
+     *
+     * @param bounds The new bounds to set.
+     */
+    void setBounds(const Rectangle& bounds);
+
     /**
      * Get the absolute bounds of this control, in pixels, including border and padding,
      * before clipping.
      *
+     * The absolute bounds of a control represents its final computed bounds after all 
+     * alignment, auto sizing, relative position and sizing has been computed. The
+     * returned bounds is in absolute coordinates, relative to the control's top-most
+     * parent container (usually its form).
+     *
      * @return The absolute bounds of this control.
      */
     const Rectangle& getAbsoluteBounds() const;
 
     /**
-     * Get the x coordinate of this control's bounds.
+     * Get the bounds of this control, relative to its parent container, after clipping.
      *
-     * @return The x coordinate of this control's bounds.
+     * @return The bounds of this control.
      */
-    float getX() const;
-    
+    const Rectangle& getClipBounds() const;
+
     /**
-     * Get the y coordinate of this control's bounds.
+     * Get the content area of this control, in screen coordinates, after clipping.
      *
-     * @return The y coordinate of this control's bounds.
+     * @return The clipping area of this control.
      */
-    float getY() const;
+    const Rectangle& getClip() const;
 
     /**
-     * Get the width of this control's bounds.
+     * Returns the auto sizing mode for this control's width.
      *
-     * @return The width of this control's bounds.
+     * @return The auto size mode for this control's width.
      */
-    float getWidth() const;
+    AutoSize getAutoWidth() const;
 
     /**
-     * Get the height of this control's bounds.
+     * Enables or disables auto sizing for this control's width.
      *
-     * @return The height of this control's bounds.
+     * This method is a simplified version of setAutoWidth(AutoSize) left intact for legacy reasons.
+     * It enables or disables the AUTO_SIZE_STRETCH mode for the control's width.
+     *
+     * @param autoWidth True to enable AUTO_SIZE_STRETCH for this control's width.
      */
-    float getHeight() const;
+    void setAutoWidth(bool autoWidth);
 
     /**
-     * Set the alignment of this control within its parent container.
+     * Sets the auto size mode for this control's width.
      *
-     * @param alignment This control's alignment.
+     * @param mode The new auto size mode for this control's width.
      */
-    void setAlignment(Alignment alignment);
+    void setAutoWidth(AutoSize mode);
 
     /**
-     * Get the alignment of this control within its parent container.
+     * Returns the auto sizing mode for this control's height.
      *
-     * @return The alignment of this control within its parent container.
+     * @return The auto size mode for this control's height.
      */
-    Alignment getAlignment() const;
+    AutoSize getAutoHeight() const;
 
     /**
-     * Set this control to fit horizontally within its parent container.
+     * Enables or disables auto sizing for this control's height.
+     *
+     * This method is a simplified version of setAutoHeight(AutoSize) left intact for legacy reasons.
+     * It enables or disables the AUTO_SIZE_STRETCH mode for the control's height.
      *
-     * @param autoWidth Whether to size this control to fit horizontally within its parent container.
+     * @param autoWidth True to enable AUTO_SIZE_STRETCH for this control's height.
      */
-    virtual void setAutoWidth(bool autoWidth);
+    void setAutoHeight(bool autoHeight);
 
     /**
-     * Get whether this control's width is set to automatically adjust to
-     * fit horizontally within its parent container.
+     * Sets the auto size mode for this control's height.
      *
-     * @return Whether this control's width is set to automatically adjust.
+     * @param mode The new auto size mode for this control's height.
      */
-    bool getAutoWidth() const;
+    void setAutoHeight(AutoSize mode);
 
     /**
-     * Set this control to fit vertically within its parent container.
+     * Set the alignment of this control within its parent container.
      *
-     * @param autoHeight Whether to size this control to fit vertically within its parent container.
+     * @param alignment This control's alignment.
      */
-    virtual void setAutoHeight(bool autoHeight);
+    void setAlignment(Alignment alignment);
 
     /**
-     * Get whether this control's height is set to automatically adjust to
-     * fit vertically within its parent container.
+     * Get the alignment of this control within its parent container.
      *
-     * @return Whether this control's height is set to automatically adjust.
+     * @return The alignment of this control within its parent container.
      */
-    bool getAutoHeight() const;
+    Alignment getAlignment() const;
 
     /**
      * Set the size of this control's border.
@@ -661,20 +791,6 @@ public:
      */
     bool isEnabled() const;
 
-    /**
-     * Get the bounds of this control, relative to its parent container, after clipping.
-     *
-     * @return The bounds of this control.
-     */
-    const Rectangle& getClipBounds() const;
-
-    /**
-     * Get the content area of this control, in screen coordinates, after clipping.
-     *
-     * @return The clipping area of this control.
-     */
-    const Rectangle& getClip() const;
-
     /**
      * Change this control's state.
      *
@@ -985,12 +1101,22 @@ protected:
     State _state;
 
     /**
-     * Position, relative to parent container's clipping window, and desired size.
+     * Bits indicating whether bounds values are absolute values or percentages.
+     */
+    int _boundsBits;
+
+    /**
+     * Local bounds, relative to parent container's clipping window, possibly stored as percentages (see _boundsBits).
+     */
+    Rectangle _relativeBounds;
+
+    /**
+     * Local bounds, relative to parent container's clipping window, and desired size.
      */
     Rectangle _bounds;
 
     /**
-     * Position, relative to parent container's clipping window, including border and padding, after clipping.
+     * Local bounds, relative to parent container's clipping window, including border and padding, after clipping.
      */
     Rectangle _clipBounds;
 
@@ -1042,12 +1168,12 @@ protected:
     /**
      * Whether the Control's width is auto-sized.
      */
-    bool _autoWidth;
+    AutoSize _autoWidth;
     
     /**
      * Whether the Control's height is auto-sized.
      */
-    bool _autoHeight;
+    AutoSize _autoHeight;
     
     /**
      * Listeners map of EventType's to a list of Listeners.

+ 20 - 3
gameplay/src/FlowLayout.cpp

@@ -8,7 +8,7 @@ namespace gameplay
 
 static FlowLayout* __instance;
 
-FlowLayout::FlowLayout()
+FlowLayout::FlowLayout() : _horizontalSpacing(0), _verticalSpacing(0)
 {
 }
 
@@ -36,6 +36,22 @@ Layout::Type FlowLayout::getType()
     return Layout::LAYOUT_FLOW;
 }
 
+int FlowLayout::getHorizontalSpacing() const
+{
+    return _horizontalSpacing;
+}
+
+int FlowLayout::getVerticalSpacing() const
+{
+    return _verticalSpacing;
+}
+
+void FlowLayout::setSpacing(int horizontalSpacing, int verticalSpacing)
+{
+    _horizontalSpacing = horizontalSpacing;
+    _verticalSpacing = verticalSpacing;
+}
+
 void FlowLayout::update(const Container* container, const Vector2& offset)
 {
     GP_ASSERT(container);
@@ -71,7 +87,8 @@ void FlowLayout::update(const Container* container, const Vector2& offset)
         if (xPosition + bounds.width >= clipWidth)
         {
             xPosition = margin.left;
-            rowY += tallestHeight;
+            rowY += tallestHeight + _verticalSpacing;
+            tallestHeight = 0;
         }
 
         yPosition = rowY + margin.top;
@@ -79,7 +96,7 @@ void FlowLayout::update(const Container* container, const Vector2& offset)
         control->setPosition(xPosition, yPosition);
         control->update(container, offset);
 
-        xPosition += bounds.width + margin.right;
+        xPosition += bounds.width + margin.right + _horizontalSpacing;
 
         float height = bounds.height + margin.top + margin.bottom;
         if (height > tallestHeight)

+ 32 - 0
gameplay/src/FlowLayout.h

@@ -23,6 +23,28 @@ public:
      */
     Layout::Type getType();
 
+    /**
+     * Returns the horizontal spacing between controls in the layout.
+     *
+     * @return The horizontal spacing between controls.
+     */
+    int getHorizontalSpacing() const;
+
+    /**
+     * Returns the vertical spacing between controls in the layout.
+     *
+     * @return The vertical spacing between controls.
+     */
+    int getVerticalSpacing() const;
+
+    /**
+     * Sets the spacing to add between controls in the layout.
+     *
+     * @param horizontalSpacing The horizontal spacing between controls.
+     * @param verticalSpacing The vertical spacing between controls.
+     */
+    void setSpacing(int horizontalSpacing, int verticalSpacing);
+
 protected:
 
     /**
@@ -33,6 +55,16 @@ protected:
      */
     void update(const Container* container, const Vector2& offset);
 
+    /**
+     * Horizontal spacing between controls.
+     */
+    int _horizontalSpacing;
+
+    /**
+     * Vertical spacing between controls.
+     */
+    int _verticalSpacing;
+
 private:
 
     /**

+ 118 - 244
gameplay/src/Form.cpp

@@ -77,11 +77,7 @@ Form* Form::create(const char* id, Theme::Style* style, Layout::Type layoutType)
     form->_theme = style->getTheme();
     form->_theme->addRef();
 
-    // Get default projection matrix.
-    Game* game = Game::getInstance();
-    Matrix::createOrthographicOffCenter(0, game->getWidth(), game->getHeight(), 0, 0, 1, &form->_defaultProjectionMatrix);
-
-    form->updateBounds();
+    form->updateFrameBuffer();
 
     __forms.push_back(form);
 
@@ -109,37 +105,57 @@ Form* Form::create(const char* url)
     }
 
     // Create new form with given ID, theme and layout.
-    const char* themeFile = formProperties->getString("theme");
-    const char* layoutString = formProperties->getString("layout");
-        
-    Layout* layout;
-    switch (getLayoutType(layoutString))
+    std::string themeFile;
+    formProperties->getPath("theme", &themeFile);
+
+    // Parse layout
+    Layout* layout = NULL;
+    Properties* layoutNS = formProperties->getNamespace("layout", true, false);
+    if (layoutNS)
     {
-    case Layout::LAYOUT_ABSOLUTE:
-        layout = AbsoluteLayout::create();
-        break;
-    case Layout::LAYOUT_FLOW:
-        layout = FlowLayout::create();
-        break;
-    case Layout::LAYOUT_VERTICAL:
-        layout = VerticalLayout::create();
-        break;
-    default:
-        GP_ERROR("Unsupported layout type '%d'.", getLayoutType(layoutString));
-        break;
+        Layout::Type layoutType = getLayoutType(layoutNS->getString("type"));
+        switch (layoutType)
+        {
+        case Layout::LAYOUT_ABSOLUTE:
+            layout = AbsoluteLayout::create();
+            break;
+        case Layout::LAYOUT_FLOW:
+            layout = FlowLayout::create();
+            static_cast<FlowLayout*>(layout)->setSpacing(layoutNS->getInt("horizontalSpacing"), layoutNS->getInt("verticalSpacing"));
+            break;
+        case Layout::LAYOUT_VERTICAL:
+            layout = VerticalLayout::create();
+            static_cast<VerticalLayout*>(layout)->setSpacing(layoutNS->getInt("spacing"));
+            break;
+        }
+    }
+    else
+    {
+        switch (getLayoutType(formProperties->getString("layout")))
+        {
+        case Layout::LAYOUT_ABSOLUTE:
+            layout = AbsoluteLayout::create();
+            break;
+        case Layout::LAYOUT_FLOW:
+            layout = FlowLayout::create();
+            break;
+        case Layout::LAYOUT_VERTICAL:
+            layout = VerticalLayout::create();
+            break;
+        }
+    }
+    if (layout == NULL)
+    {
+        GP_ERROR("Unsupported layout type for form: %s", url);
     }
 
-    Theme* theme = Theme::create(themeFile);
+    Theme* theme = Theme::create(themeFile.c_str());
     GP_ASSERT(theme);
 
     Form* form = new Form();
     form->_layout = layout;
     form->_theme = theme;
 
-    // Get default projection matrix.
-    Game* game = Game::getInstance();
-    Matrix::createOrthographicOffCenter(0, game->getWidth(), game->getHeight(), 0, 0, 1, &form->_defaultProjectionMatrix);
-
     Theme::Style* style = NULL;
     const char* styleName = formProperties->getString("style");
     if (styleName)
@@ -154,25 +170,6 @@ Form* Form::create(const char* url)
 
     form->_consumeInputEvents = formProperties->getBool("consumeInputEvents", false);
 
-    // Alignment
-    if ((form->_alignment & Control::ALIGN_BOTTOM) == Control::ALIGN_BOTTOM)
-    {
-        form->_bounds.y = Game::getInstance()->getHeight() - form->_bounds.height;
-    }
-    else if ((form->_alignment & Control::ALIGN_VCENTER) == Control::ALIGN_VCENTER)
-    {
-        form->_bounds.y = Game::getInstance()->getHeight() * 0.5f - form->_bounds.height * 0.5f;
-    }
-
-    if ((form->_alignment & Control::ALIGN_RIGHT) == Control::ALIGN_RIGHT)
-    {
-        form->_bounds.x = Game::getInstance()->getWidth() - form->_bounds.width;
-    }
-    else if ((form->_alignment & Control::ALIGN_HCENTER) == Control::ALIGN_HCENTER)
-    {
-        form->_bounds.x = Game::getInstance()->getWidth() * 0.5f - form->_bounds.width * 0.5f;
-    }
-
     form->_scroll = getScroll(formProperties->getString("scroll"));
     form->_scrollBarsAutoHide = formProperties->getBool("scrollBarsAutoHide");
     if (form->_scrollBarsAutoHide)
@@ -185,7 +182,7 @@ Form* Form::create(const char* url)
 
     SAFE_DELETE(properties);
     
-    form->updateBounds();
+    form->updateFrameBuffer();
 
     __forms.push_back(form);
 
@@ -212,42 +209,37 @@ Theme* Form::getTheme() const
     return _theme;
 }
 
-void Form::setSize(float width, float height)
+void Form::updateFrameBuffer()
 {
-    if (_autoWidth)
-    {
-        width = Game::getInstance()->getWidth();
-    }
+    float width = _absoluteClipBounds.width;
+    float height = _absoluteClipBounds.height;
 
-    if (_autoHeight)
-    {
-        height = Game::getInstance()->getHeight();
-    }
+    SAFE_RELEASE(_frameBuffer);
+    SAFE_DELETE(_spriteBatch);
 
-    if (width != 0.0f && height != 0.0f &&
-        (width != _bounds.width || height != _bounds.height))
+    if (width != 0.0f && height != 0.0f)
     {
         // Width and height must be powers of two to create a texture.
         unsigned int w = nextPowerOfTwo(width);
         unsigned int h = nextPowerOfTwo(height);
         _u2 = width / (float)w;
         _v1 = height / (float)h;
-
-        // Create framebuffer if necessary. TODO: Use pool to cache.
-        if (_frameBuffer)
-            SAFE_RELEASE(_frameBuffer)
         
         _frameBuffer = FrameBuffer::create(_id.c_str(), w, h);
         GP_ASSERT(_frameBuffer);
 
-        // Re-create projection matrix.
+        // Re-create projection matrix for drawing onto framebuffer
         Matrix::createOrthographicOffCenter(0, width, height, 0, 0, 1, &_projectionMatrix);
 
-        // Re-create sprite batch.
-        SAFE_DELETE(_spriteBatch);
+        // Re-create sprite batch
         _spriteBatch = SpriteBatch::create(_frameBuffer->getRenderTarget()->getTexture());
         GP_ASSERT(_spriteBatch);
 
+        // Compute full-viewport ortho matrix for drawing frame buffer onto screen
+        Matrix viewportProjection;
+        Matrix::createOrthographicOffCenter(0, Game::getInstance()->getViewport().width, Game::getInstance()->getViewport().height, 0, 0, 1, &viewportProjection);
+        _spriteBatch->setProjectionMatrix(viewportProjection);
+
         // Clear the framebuffer black
         Game* game = Game::getInstance();
         FrameBuffer* previousFrameBuffer = _frameBuffer->bind();
@@ -256,57 +248,12 @@ void Form::setSize(float width, float height)
         game->setViewport(Rectangle(0, 0, width, height));
         _theme->setProjectionMatrix(_projectionMatrix);
         game->clear(Game::CLEAR_COLOR, Vector4::zero(), 1.0, 0);
-        _theme->setProjectionMatrix(_defaultProjectionMatrix);
 
         previousFrameBuffer->bind();
         game->setViewport(previousViewport);
-    }
-    _bounds.width = width;
-    _bounds.height = height;
-    _dirty = true;
-}
-
-void Form::setBounds(const Rectangle& bounds)
-{
-    setPosition(bounds.x, bounds.y);
-    setSize(bounds.width, bounds.height);
-}
-
-void Form::setWidth(float width)
-{
-    setSize(width, _bounds.height);
-}
-
-void Form::setHeight(float height)
-{
-    setSize(_bounds.width, height);
-}
-
-void Form::setAutoWidth(bool autoWidth)
-{
-    if (_autoWidth != autoWidth)
-    {
-        _autoWidth = autoWidth;
-        _dirty = true;
-
-        if (_autoWidth)
-        {
-            setSize(_bounds.width, Game::getInstance()->getWidth());
-        }
-    }
-}
-
-void Form::setAutoHeight(bool autoHeight)
-{
-    if (_autoHeight != autoHeight)
-    {
-        _autoHeight = autoHeight;
-        _dirty = true;
 
-        if (_autoHeight)
-        {
-            setSize(_bounds.width, Game::getInstance()->getHeight());
-        }
+        // Force any attached node to be updated
+        setNode(_node);
     }
 }
 
@@ -332,12 +279,20 @@ static Effect* createEffect()
 
 void Form::setNode(Node* node)
 {
-    // If the user wants a custom node then we need to create a 3D quad
-    if (node && node != _node)
+    // If we were already attached to a node, remove ourself from it
+    if (_node)
+    {
+        _node->setModel(NULL);
+        _nodeQuad = NULL;
+        _nodeMaterial = NULL;
+        _node = NULL;
+    }
+
+    if (node)
     {
         // Set this Form up to be 3D by initializing a quad.
-        float x2 = _bounds.width;
-        float y2 = _bounds.height;
+        float x2 = _absoluteBounds.width;
+        float y2 = _absoluteBounds.height;
         float vertices[] =
         {
             0, y2, 0,   0, _v1,
@@ -374,11 +329,14 @@ void Form::setNode(Node* node)
         _nodeMaterial->setParameterAutoBinding("u_worldViewProjectionMatrix", RenderState::WORLD_VIEW_PROJECTION_MATRIX);
 
         // Bind the texture from the framebuffer and set the texture to clamp
-        Texture::Sampler* sampler = Texture::Sampler::create(_frameBuffer->getRenderTarget()->getTexture());
-        GP_ASSERT(sampler);
-        sampler->setWrapMode(Texture::CLAMP, Texture::CLAMP);
-        _nodeMaterial->getParameter("u_texture")->setValue(sampler);
-        sampler->release();
+        if (_frameBuffer)
+        {
+            Texture::Sampler* sampler = Texture::Sampler::create(_frameBuffer->getRenderTarget()->getTexture());
+            GP_ASSERT(sampler);
+            sampler->setWrapMode(Texture::CLAMP, Texture::CLAMP);
+            _nodeMaterial->getParameter("u_texture")->setValue(sampler);
+            sampler->release();
+        }
 
         RenderState::StateBlock* rsBlock = _nodeMaterial->getStateBlock();
         rsBlock->setDepthWrite(true);
@@ -386,14 +344,15 @@ void Form::setNode(Node* node)
         rsBlock->setBlendSrc(RenderState::BLEND_SRC_ALPHA);
         rsBlock->setBlendDst(RenderState::BLEND_ONE_MINUS_SRC_ALPHA);
     }
+
     _node = node;
 }
 
 void Form::update(float elapsedTime)
 {
-    if (isDirty())
+    if (true)//isDirty())
     {
-        updateBounds();
+        update(NULL, Vector2::zero());
 
         // Cache themed attributes for performance.
         _skin = getSkin(_state);
@@ -411,122 +370,26 @@ void Form::update(float elapsedTime)
     }
 }
 
-void Form::updateBounds()
-{   
-    _clearBounds.set(_absoluteClipBounds);
-
-    // Calculate the clipped bounds.
-    float x = 0;
-    float y = 0;
-    float width = _bounds.width;
-    float height = _bounds.height;
-
-    Rectangle clip(0, 0, _bounds.width, _bounds.height);
-
-    float clipX2 = clip.x + clip.width;
-    float x2 = clip.x + x + width;
-    if (x2 > clipX2)
-        width -= x2 - clipX2;
-
-    float clipY2 = clip.y + clip.height;
-    float y2 = clip.y + y + height;
-    if (y2 > clipY2)
-        height -= y2 - clipY2;
-
-    if (x < 0)
-    {
-        width += x;
-        x = -x;
-    }
-    else
-    {
-        x = 0;
-    }
-
-    if (y < 0)
-    {
-        height += y;
-        y = -y;
-    }
-    else
-    {
-        y = 0;
-    }
-
-    _clipBounds.set(x, y, width, height);
-
-    // Calculate the absolute bounds.
-    x = 0;
-    y = 0;
-    _absoluteBounds.set(x, y, _bounds.width, _bounds.height);
-
-    // Calculate the absolute viewport bounds. Absolute bounds minus border and padding.
-    const Theme::Border& border = getBorder(_state);
-    const Theme::Padding& padding = getPadding();
-
-    x += border.left + padding.left;
-    y += border.top + padding.top;
-    width = _bounds.width - border.left - padding.left - border.right - padding.right;
-    height = _bounds.height - border.top - padding.top - border.bottom - padding.bottom;
-
-    _viewportBounds.set(x, y, width, height);
-
-    // Calculate the clip area. Absolute bounds, minus border and padding, clipped to the parent container's clip area.
-    clipX2 = clip.x + clip.width;
-    x2 = x + width;
-    if (x2 > clipX2)
-        width = clipX2 - x;
-
-    clipY2 = clip.y + clip.height;
-    y2 = y + height;
-    if (y2 > clipY2)
-        height = clipY2 - y;
-
-    if (x < clip.x)
-    {
-        float dx = clip.x - x;
-        width -= dx;
-        x = clip.x;
-    }
-
-    if (y < clip.y)
-    {
-        float dy = clip.y - y;
-        height -= dy;
-        y = clip.y;
-    }
- 
-    _viewportClipBounds.set(x, y, width, height);
-    _absoluteClipBounds.set(x - border.left - padding.left, y - border.top - padding.top,
-                            width + border.left + padding.left + border.right + padding.right,
-                            height + border.top + padding.top + border.bottom + padding.bottom);
-    if (_clearBounds.isEmpty())
-    {
-        _clearBounds.set(_absoluteClipBounds);
-    }
+void Form::update(const Control* container, const Vector2& offset)
+{
+    // Store previous absolute bounds
+    Rectangle oldAbsoluteClipBounds = _absoluteClipBounds;
 
-    // Get scrollbar images and diminish clipping bounds to make room for scrollbars.
-    if ((_scroll & SCROLL_HORIZONTAL) == SCROLL_HORIZONTAL)
-    {
-        _scrollBarLeftCap = getImage("scrollBarLeftCap", _state);
-        _scrollBarHorizontal = getImage("horizontalScrollBar", _state);
-        _scrollBarRightCap = getImage("scrollBarRightCap", _state);
+    _layout->align(this, NULL);
 
-        _viewportClipBounds.height -= _scrollBarHorizontal->getRegion().height;
-    }
+    Container::update(container, offset);
 
-    if ((_scroll & SCROLL_VERTICAL) == SCROLL_VERTICAL)
+    if (_absoluteClipBounds.width != oldAbsoluteClipBounds.width || _absoluteClipBounds.height != oldAbsoluteClipBounds.height)
     {
-        _scrollBarTopCap = getImage("scrollBarTopCap", _state);
-        _scrollBarVertical = getImage("verticalScrollBar", _state);
-        _scrollBarBottomCap = getImage("scrollBarBottomCap", _state);
-        
-        _viewportClipBounds.width -= _scrollBarVertical->getRegion().width;
+        updateFrameBuffer();
     }
 }
 
 unsigned int Form::draw()
 {
+    if (!_visible || !_frameBuffer)
+        return 0;
+
     // The first time a form is drawn, its contents are rendered into a framebuffer.
     // The framebuffer will only be drawn into again when the contents of the form change.
     // If this form has a node then it's a 3D form and the framebuffer will be used
@@ -536,24 +399,22 @@ unsigned int Form::draw()
     // to render the contents of the framebuffer directly to the display.
 
     // Check whether this form has changed since the last call to draw() and if so, render into the framebuffer.
-    if (isDirty())
+    if (true)//isDirty())
     {
-        GP_ASSERT(_frameBuffer);
         FrameBuffer* previousFrameBuffer = _frameBuffer->bind();
 
         Game* game = Game::getInstance();
         Rectangle prevViewport = game->getViewport();
-        game->setViewport(Rectangle(0, 0, _bounds.width, _bounds.height));
+        game->setViewport(Rectangle(0, 0, _absoluteClipBounds.width, _absoluteClipBounds.height));
 
         GP_ASSERT(_theme);
         _theme->setProjectionMatrix(_projectionMatrix);
-        
+
         // By setting needsClear to true here, an optimization meant to clear and redraw only areas of the form
         // that have changed is disabled.  Currently, repositioning controls can result in areas of the screen being cleared
         // after another control has been drawn there.  This should probably be done in two passes -- one to clear areas where
         // dirty controls were last frame, and another to draw them where they are now.
-        Container::draw(_theme->getSpriteBatch(), Rectangle(0, 0, _bounds.width, _bounds.height), true, false, _bounds.height);
-        _theme->setProjectionMatrix(_defaultProjectionMatrix);
+        Container::draw(_theme->getSpriteBatch(), _absoluteClipBounds, /*_skin != NULL*/ true, false, _absoluteClipBounds.height);
 
         // Restore the previous game viewport.
         game->setViewport(prevViewport);
@@ -570,14 +431,6 @@ unsigned int Form::draw()
     else
     {
         // Otherwise we draw the framebuffer in ortho space with a spritebatch.
-        if (!_spriteBatch)
-        {
-            _spriteBatch = SpriteBatch::create(_frameBuffer->getRenderTarget()->getTexture());
-            GP_ASSERT(_spriteBatch);
-        }
-
-        _spriteBatch->getSampler()->setFilterMode(Texture::LINEAR, Texture::LINEAR);
-        _spriteBatch->getSampler()->setWrapMode(Texture::CLAMP, Texture::CLAMP);
         _spriteBatch->start();
         _spriteBatch->draw(_bounds.x, _bounds.y, 0, _bounds.width, _bounds.height, 0, _v1, _u2, 0, Vector4::one());
         _spriteBatch->finish();
@@ -743,6 +596,27 @@ void Form::gamepadEventInternal(Gamepad::GamepadEvent evt, Gamepad* gamepad, uns
     }
 }
 
+void Form::resizeEventInternal(unsigned int width, unsigned int height)
+{
+    for (size_t i = 0; i < __forms.size(); ++i)
+    {
+        Form* form = __forms[i];
+        if (form)
+        {
+            if (form->_spriteBatch)
+            {
+                // Update viewport projection matrix
+                Matrix viewportProjection;
+                Matrix::createOrthographicOffCenter(0, Game::getInstance()->getViewport().width, Game::getInstance()->getViewport().height, 0, 0, 1, &viewportProjection);
+                form->_spriteBatch->setProjectionMatrix(viewportProjection);
+            }
+
+            // Dirty the form
+            form->_dirty = true;
+        }
+    }
+}
+
 bool Form::projectPoint(int x, int y, Vector3* point)
 {
     Scene* scene = _node->getScene();

+ 20 - 49
gameplay/src/Form.h

@@ -92,49 +92,6 @@ public:
      */
     Theme* getTheme() const;
 
-    /**
-     * Set the desired size of this form.
-     *
-     * @param width The width.
-     * @param height The height.
-     */
-    virtual void setSize(float width, float height);
-
-    /**
-     * Set the bounds of this form.
-     *
-     * @param bounds The new bounds to set.
-     */
-    virtual void setBounds(const Rectangle& bounds);
-
-    /** 
-     * Set the desired width of the form.
-     *
-     * @param width The width.
-     */
-    virtual void setWidth(float width);
-
-    /** 
-     * Set the desired height of the form.
-     *
-     * @param height The height.
-     */
-    virtual void setHeight(float height);
-
-    /**
-     * Set this form's width to that of the display.
-     *
-     * @param autoWidth Whether to set this form's width to that of the display.
-     */
-    virtual void setAutoWidth(bool autoWidth);
-
-    /**
-     * Set this form's height to that of the display.
-     *
-     * @param autoHeight Whether to set this form's height to that of the display.
-     */
-    virtual void setAutoHeight(bool autoHeight);
-
     /**
      * Attach this form to a node.
      *
@@ -162,6 +119,13 @@ public:
      */
     const char* getType() const;
 
+protected:
+
+    /**
+     * @see Control::update
+     */
+    void update(const Control* container, const Vector2& offset);
+
 private:
     
     /**
@@ -186,11 +150,6 @@ private:
      */
     void initializeQuad(Mesh* mesh);
 
-    /**
-     * Update this form's bounds.
-     */
-    void updateBounds();
-
     /**
      * Updates all visible, enabled forms.
      */
@@ -226,6 +185,14 @@ private:
      */
     static void gamepadEventInternal(Gamepad::GamepadEvent evt, Gamepad* gamepad, unsigned int analogIndex);
 
+    /**
+     * Fired by the platform when the game window resizes.
+     *
+     * @param width The new window width.
+     * @param height The new window height.
+     */
+    static void resizeEventInternal(unsigned int width, unsigned int height);
+
     /**
      * Get the next highest power of two of an integer.  Used when creating framebuffers.
      *
@@ -246,6 +213,11 @@ private:
      */
     bool projectPoint(int x, int y, Vector3* point);
 
+    /**
+     * Called when the form is resized to update its internal frame buffer.
+     */
+    void updateFrameBuffer();
+
     Theme* _theme;                      // The Theme applied to this Form.
     FrameBuffer* _frameBuffer;          // FBO the Form is rendered into for texturing the quad. 
     SpriteBatch* _spriteBatch;
@@ -255,7 +227,6 @@ private:
     float _u2;
     float _v1;
     Matrix _projectionMatrix;           // Orthographic projection matrix to be set on SpriteBatch objects when rendering into the FBO.
-    Matrix _defaultProjectionMatrix;
     bool _isGamepad;
 };
 

+ 2 - 0
gameplay/src/Game.h

@@ -264,6 +264,8 @@ public:
      * associated with the game.
      *
      * @return The script controller for this game.
+     *
+     * @script{ignore}
      */
     inline SocialController* getSocialController() const;
 

+ 19 - 1
gameplay/src/ImageControl.cpp

@@ -150,4 +150,22 @@ void ImageControl::drawImages(SpriteBatch* spriteBatch, const Rectangle& clip)
     spriteBatch->start();
 }
 
-}
+void ImageControl::update(const Control* container, const Vector2& offset)
+{
+    Button::update(container, offset);
+
+    if (_batch)
+    {
+        if (_autoWidth == Control::AUTO_SIZE_FIT)
+        {
+            setWidth(_batch->getSampler()->getTexture()->getWidth());
+        }
+
+        if (_autoHeight == Control::AUTO_SIZE_FIT)
+        {
+            setHeight(_batch->getSampler()->getTexture()->getWidth());
+        }
+    }
+}
+
+}

+ 5 - 0
gameplay/src/ImageControl.h

@@ -123,6 +123,11 @@ protected:
 
     void drawImages(SpriteBatch* spriteBatch, const Rectangle& clip);
 
+    /**
+     * @see Control#update(const Control*, const Vector2&)
+     */
+    void update(const Control* container, const Vector2& offset);
+
     // Source region.
     Rectangle _srcRegion;
     // Destination region.

+ 12 - 1
gameplay/src/Label.cpp

@@ -87,11 +87,22 @@ void Label::update(const Control* container, const Vector2& offset)
 {
     Control::update(container, offset);
 
-    _textBounds.set(_viewportBounds);
+    _textBounds.set((int)_viewportBounds.x, (int)_viewportBounds.y, _viewportBounds.width, _viewportBounds.height);
 
     _font = getFont(_state);
     _textColor = getTextColor(_state);
     _textColor.w *= _opacity;
+
+    Font* font = getFont(_state);
+    if ((_autoWidth == Control::AUTO_SIZE_FIT || _autoHeight == Control::AUTO_SIZE_FIT) && font)
+    {
+        unsigned int w, h;
+        font->measureText(_text.c_str(), getFontSize(_state), &w, &h);
+        if (_autoWidth == Control::AUTO_SIZE_FIT)
+            setWidth(w + getBorder(_state).left + getBorder(_state).right + getPadding().left + getPadding().right);
+        if (_autoHeight == Control::AUTO_SIZE_FIT)
+            setHeight(h + getBorder(_state).top + getBorder(_state).bottom + getPadding().top + getPadding().bottom);
+    }
 }
 
 void Label::drawText(const Rectangle& clip)

+ 15 - 28
gameplay/src/Layout.cpp

@@ -2,6 +2,7 @@
 #include "Layout.h"
 #include "Control.h"
 #include "Container.h"
+#include "Game.h"
 
 namespace gameplay
 {
@@ -9,21 +10,19 @@ namespace gameplay
 void Layout::align(Control* control, const Container* container)
 {
     GP_ASSERT(control);
-    GP_ASSERT(container);
 
     if (control->_alignment != Control::ALIGN_TOP_LEFT ||
-        control->_isAlignmentSet ||
-        control->_autoWidth || control->_autoHeight)
+        control->_isAlignmentSet)
     {
-        Rectangle controlBounds = control->getBounds();
+        const Rectangle& controlBounds = control->getBounds();
         const Theme::Margin& controlMargin = control->getMargin();
-        const Rectangle& containerBounds = container->getBounds();
-        const Theme::Border& containerBorder = container->getBorder(container->getState());
-        const Theme::Padding& containerPadding = container->getPadding();
+        const Rectangle& containerBounds = container ? container->getBounds() : Game::getInstance()->getViewport();
+        const Theme::Border& containerBorder = container ? container->getBorder(container->getState()) : Theme::Border::empty();
+        const Theme::Padding& containerPadding = container ? container->getPadding() : Theme::Padding::empty();
 
         float clipWidth;
         float clipHeight; 
-        if (container->getScroll() != Container::SCROLL_NONE)
+        if (container && (container->getScroll() != Container::SCROLL_NONE))
         {
             const Rectangle& verticalScrollBarBounds = container->getImageRegion("verticalScrollBar", container->getState());
             const Rectangle& horizontalScrollBarBounds = container->getImageRegion("horizontalScrollBar", container->getState());
@@ -36,51 +35,39 @@ void Layout::align(Control* control, const Container* container)
             clipHeight = containerBounds.height - containerBorder.top - containerBorder.bottom - containerPadding.top - containerPadding.bottom;
         }
 
-        if (control->_autoWidth)
-        {
-            controlBounds.width = clipWidth - controlMargin.left - controlMargin.right;
-        }
-
-        if (control->_autoHeight)
-        {
-            controlBounds.height = clipHeight - controlMargin.top - controlMargin.bottom;
-        }
-
         // Vertical alignment
-        if(control->_isAlignmentSet || control->_autoHeight)
+        if (control->_isAlignmentSet || control->_autoHeight)
         {
             if ((control->_alignment & Control::ALIGN_BOTTOM) == Control::ALIGN_BOTTOM)
             {
-                controlBounds.y = clipHeight - controlBounds.height - controlMargin.bottom;
+                control->setY(clipHeight - controlBounds.height - controlMargin.bottom);
             }
             else if ((control->_alignment & Control::ALIGN_VCENTER) == Control::ALIGN_VCENTER)
             {
-                controlBounds.y = clipHeight * 0.5f - controlBounds.height * 0.5f;
+                control->setY(clipHeight * 0.5f - controlBounds.height * 0.5f);
             }
             else if ((control->_alignment & Control::ALIGN_TOP) == Control::ALIGN_TOP)
             {
-                controlBounds.y = controlMargin.top;
+                control->setY(controlMargin.top);
             }
         }
 
         // Horizontal alignment
-        if(control->_isAlignmentSet || control->_autoWidth)
+        if (control->_isAlignmentSet)
         {
             if ((control->_alignment & Control::ALIGN_RIGHT) == Control::ALIGN_RIGHT)
             {
-                controlBounds.x = clipWidth - controlBounds.width - controlMargin.right;
+                control->setX(clipWidth - controlBounds.width - controlMargin.right);
             }
             else if ((control->_alignment & Control::ALIGN_HCENTER) == Control::ALIGN_HCENTER)
             {
-                controlBounds.x = clipWidth * 0.5f - controlBounds.width * 0.5f;
+                control->setX(clipWidth * 0.5f - controlBounds.width * 0.5f);
             }
             else if ((control->_alignment & Control::ALIGN_LEFT) == Control::ALIGN_LEFT)
             {
-                controlBounds.x = controlMargin.left;
+                control->setX(controlMargin.left);
             }
         }
-
-        control->setBounds(controlBounds);
     }
 }
 

+ 1 - 1
gameplay/src/ParticleEmitter.cpp

@@ -9,7 +9,7 @@
 #define PARTICLE_COUNT_MAX                       100
 #define PARTICLE_EMISSION_RATE                   10
 #define PARTICLE_EMISSION_RATE_TIME_INTERVAL     1000.0f / (float)PARTICLE_EMISSION_RATE
-#define PARTICLE_UPDATE_RATE_MAX                 16
+#define PARTICLE_UPDATE_RATE_MAX                 8
 
 namespace gameplay
 {

+ 2 - 0
gameplay/src/Platform.cpp

@@ -74,6 +74,8 @@ void Platform::resizeEventInternal(unsigned int width, unsigned int height)
         game->resizeEvent(width, height);
         game->getScriptController()->resizeEvent(width, height);
     }
+
+    Form::resizeEventInternal(width, height);
 }
 
 void Platform::gamepadEventInternal(Gamepad::GamepadEvent evt, Gamepad* gamepad, unsigned int analogIndex)

+ 13 - 17
gameplay/src/Properties.cpp

@@ -594,30 +594,26 @@ void Properties::rewind()
     _namespacesItr = _namespaces.end();
 }
 
-Properties* Properties::getNamespace(const char* id, bool searchNames) const
+Properties* Properties::getNamespace(const char* id, bool searchNames, bool recurse) const
 {
     GP_ASSERT(id);
 
-    Properties* ret = NULL;
-    std::vector<Properties*>::const_iterator it;
-    
-    for (it = _namespaces.begin(); it < _namespaces.end(); ++it)
+    for (std::vector<Properties*>::const_iterator it = _namespaces.begin(); it < _namespaces.end(); ++it)
     {
-        ret = *it;
-        if (strcmp(searchNames ? ret->_namespace.c_str() : ret->_id.c_str(), id) == 0)
-        {
-            return ret;
-        }
+        Properties* p = *it;
+        if (strcmp(searchNames ? p->_namespace.c_str() : p->_id.c_str(), id) == 0)
+            return p;
         
-        // Search recursively.
-        ret = ret->getNamespace(id, searchNames);
-        if (ret != NULL)
+        if (recurse)
         {
-            return ret;
+            // Search recursively.
+            p = p->getNamespace(id, searchNames, true);
+            if (p)
+                return p;
         }
     }
 
-    return ret;
+    return NULL;
 }
 
 const char* Properties::getNamespace() const
@@ -704,7 +700,7 @@ Properties::Type Properties::getType(const char* name) const
     }
 }
 
-const char* Properties::getString(const char* name) const
+const char* Properties::getString(const char* name, const char* defaultValue) const
 {
     if (name)
     {
@@ -722,7 +718,7 @@ const char* Properties::getString(const char* name) const
         }
     }
 
-    return NULL;
+    return defaultValue;
 }
 
 bool Properties::getBool(const char* name, bool defaultValue) const

+ 8 - 5
gameplay/src/Properties.h

@@ -182,18 +182,20 @@ public:
     void rewind();
 
     /**
-     * Get a specific namespace by ID or name. This method will perform
-     * a depth-first search on all namespaces and inner namespaces within
-     * this Property.
+     * Get a specific namespace by ID or name. This method will optionally
+     * perform a depth-first search on all namespaces and inner namespaces
+     * within this Property.
      *
      * @param id The ID or name of the namespace to find.
      * @param searchNames If true, namespace names are used in the search,
      *      instead of namespace IDs. By default this parameter is false
      *      and namespace IDs are searched.
+     * @param recurse If true, perform a depth-first search, otherwise search
+     *      only the immediate child namespaces.
      * 
      * @return A properties object with the given ID or name.
      */
-    Properties* getNamespace(const char* id, bool searchNames = false) const;
+    Properties* getNamespace(const char* id, bool searchNames = false, bool recurse = true) const;
 
     /**
      * Get the name of this Property's namespace.
@@ -233,10 +235,11 @@ public:
      * whatever the intended type of the property.
      *
      * @param name The name of the property to interpret, or NULL to return the current property's value.
+     * @param defaultValue The default value to return if the specified property does not exist.
      * 
      * @return The value of the given property as a string, or the empty string if no property with that name exists.
      */
-    const char* getString(const char* name = NULL) const;
+    const char* getString(const char* name = NULL, const char* defaultValue = NULL) const;
 
     /**
      * Interpret the value of the given property as a boolean.

+ 13 - 3
gameplay/src/RadioButton.cpp

@@ -196,11 +196,21 @@ void RadioButton::update(const Control* container, const Vector2& offset)
     {
         size.set(_imageSize);
     }
-    float iconWidth = size.x;
 
-    _textBounds.x += iconWidth + 5;
-    _textBounds.width -= iconWidth + 5;
+    if (_autoWidth == Control::AUTO_SIZE_FIT)
+    {
+        // Text-only width was already measured in Label::update - append image
+        setWidth(size.x + _bounds.width + 5);
+    }
+
+    if (_autoHeight == Control::AUTO_SIZE_FIT)
+    {
+        // Text-only width was already measured in Label::update - append image
+        setHeight(std::max(getHeight(), size.y));
+    }
 
+    _textBounds.x += size.x + 5;
+    
     if (_selected)
     {
         _image = getImage("selected", _state);

+ 17 - 5
gameplay/src/ScriptController.cpp

@@ -431,12 +431,20 @@ void ScriptController::loadScript(const char* path, bool forceReload)
     std::set<std::string>::iterator iter = _loadedScripts.find(path);
     if (iter == _loadedScripts.end() || forceReload)
     {
+        bool success = false;
+        if (iter == _loadedScripts.end())
+            _loadedScripts.insert(path); // insert before loading script to prevent load recursion
+
 #ifdef __ANDROID__
         const char* scriptContents = FileSystem::readAll(path);
         if (luaL_dostring(_lua, scriptContents))
         {
             GP_WARN("Failed to run Lua script with error: '%s'.", lua_tostring(_lua, -1));
         }
+        else
+        {
+            success = true;
+        }
         SAFE_DELETE_ARRAY(scriptContents);
 #else
         std::string fullPath;
@@ -449,10 +457,15 @@ void ScriptController::loadScript(const char* path, bool forceReload)
         {
             GP_WARN("Failed to run Lua script with error: '%s'.", lua_tostring(_lua, -1));
         }
+        else
+        {
+            success = true;
+        }
 #endif
-        if (iter == _loadedScripts.end())
+        if (!success && (iter == _loadedScripts.end()))
         {
-            _loadedScripts.insert(path);
+            iter = _loadedScripts.find(path);
+            _loadedScripts.erase(iter);
         }
     }
 }
@@ -463,11 +476,10 @@ std::string ScriptController::loadUrl(const char* url)
     std::string id;
     splitURL(url, &file, &id);
 
-    // Make sure the function isn't empty.
     if (id.size() <= 0)
     {
-        GP_ERROR("Got an empty function name when parsing function url '%s'.", url);
-        return std::string();
+        // The url does not reference a script - only a function
+        return file;
     }
 
     // Ensure the script is loaded.

+ 13 - 1
gameplay/src/Slider.cpp

@@ -495,7 +495,7 @@ void Slider::update(const Control* container, const Vector2& offset)
         {
             _value += (total * GAMEPAD_FRACTION) * _delta;
         }
-            
+
         if (_value > _max)
             _value = _max;
         else if (_value < _min)
@@ -506,6 +506,18 @@ void Slider::update(const Control* container, const Vector2& offset)
             notifyListeners(Control::Listener::VALUE_CHANGED);
         }
     }
+
+    if (_autoHeight == Control::AUTO_SIZE_FIT)
+    {
+        float height = _minImage->getRegion().height;
+        height = std::max(height, _maxImage->getRegion().height);
+        height = std::max(height, _markerImage->getRegion().height);
+        height = std::max(height, _trackImage->getRegion().height);
+        height += _bounds.height;
+        if (_valueTextVisible && _font)
+            height += getFontSize(_state);
+        setHeight(height);
+    }
 }
 
 void Slider::draw(SpriteBatch* spriteBatch, const Rectangle& clip, bool needsClear, bool cleared, float targetHeight)

+ 2 - 0
gameplay/src/SocialAchievement.h

@@ -6,6 +6,8 @@ namespace gameplay
 
 /**
  * Defines a social achievement in a game.
+ *
+ * @script{ignore}
  */
 class SocialAchievement
 {

+ 2 - 0
gameplay/src/SocialChallenge.h

@@ -6,6 +6,8 @@ namespace gameplay
 
 /**
  * Defines a social challenge between social players.
+ *
+ * @script{ignore}
  */
 class SocialChallenge
 {

+ 2 - 2
gameplay/src/SocialController.cpp

@@ -2,7 +2,7 @@
 #include "SocialController.h"
 #include "Game.h"
 #include "social/ScoreloopSocialSession.h"
-#include "social/GoogleGamesSocialSession.h"
+#include "social/GooglePlaySocialSession.h"
 
 namespace gameplay
 {
@@ -77,7 +77,7 @@ void SocialController::authenticate(SocialSessionListener* listener)
     	providerStr = socialProperties->getString("provider");
     }
 
-    if (strcmp(providerStr, "GoogleGames") == 0)
+    if (strcmp(providerStr, "GooglePlay") == 0)
     {
         _session = GoogleGamesSocialSession::authenticate(listener, socialProperties);
     }

+ 2 - 1
gameplay/src/SocialController.h

@@ -32,7 +32,8 @@ namespace gameplay
              hard = 2
          }
     }
-
+ *
+ * @script{ignore}
  */
 class SocialController
 {

+ 2 - 0
gameplay/src/SocialPlayer.h

@@ -8,6 +8,8 @@ namespace gameplay
  * Defines a social player.
  *
  * This can either be the authenticated user, friend or community user (not friend yet...).
+ *
+ * @script{ignore}
  */
 class SocialPlayer
 {

+ 3 - 1
gameplay/src/SocialScore.h

@@ -5,7 +5,9 @@ namespace gameplay
 {
 
 /**
- * Defines an abstract class for a score that resides in a leaderboard
+ * Defines an abstract class for a score that resides in a leaderboard.
+ *
+ * @script{ignore}
  */
 class SocialScore
 {

+ 2 - 0
gameplay/src/SocialSession.h

@@ -13,6 +13,8 @@ namespace gameplay
 
 /**
  * Defines an abstract class for typical social game activities running with an authenticated session.
+ *
+ * @script{ignore}
  */
 class SocialSession
 {

+ 2 - 0
gameplay/src/SocialSessionListener.h

@@ -13,6 +13,8 @@ class SocialSession;
 
 /**
  * Defines a class for handling session responses to various session request.
+ *
+ * @script{ignore}
  */
 class SocialSessionListener
 {

+ 1 - 1
gameplay/src/SpriteBatch.cpp

@@ -133,7 +133,7 @@ SpriteBatch* SpriteBatch::create(Texture* texture,  Effect* effect, unsigned int
 
 	// Bind an ortho projection to the material by default (user can override with setProjectionMatrix)
 	Game* game = Game::getInstance();
-	Matrix::createOrthographicOffCenter(0, game->getWidth(), game->getHeight(), 0, 0, 1, &batch->_projectionMatrix);
+    Matrix::createOrthographicOffCenter(0, game->getViewport().width, game->getViewport().height, 0, 0, 1, &batch->_projectionMatrix);
 	material->getParameter("u_projectionMatrix")->bindValue(batch, &SpriteBatch::getProjectionMatrix);
 	
     return batch;

+ 9 - 8
gameplay/src/Theme.cpp

@@ -88,8 +88,9 @@ Theme* Theme::create(const char* url)
     theme->_url = url;
         
     // Parse the Properties object and set up the theme.
-    const char* textureFile = themeProperties->getString("texture");
-    theme->_texture = Texture::create(textureFile, false);
+    std::string textureFile;
+    themeProperties->getPath("texture", &textureFile);
+    theme->_texture = Texture::create(textureFile.c_str(), false);
     GP_ASSERT(theme->_texture);
     theme->_spriteBatch = SpriteBatch::create(theme->_texture);
     GP_ASSERT(theme->_spriteBatch);
@@ -177,11 +178,11 @@ Theme* Theme::create(const char* url)
                         innerSpace->getColor("textColor", &textColor);
                     }
 
-                    const char* fontPath = innerSpace->getString("font");
                     Font* font = NULL;
-                    if (fontPath)
+                    std::string fontPath;
+                    if (innerSpace->getPath("font", &fontPath))
                     {
-                        font = Font::create(fontPath);
+                        font = Font::create(fontPath.c_str());
                     }
                     unsigned int fontSize = innerSpace->getInt("fontSize");
                     const char* textAlignmentString = innerSpace->getString("textAlignment");
@@ -261,11 +262,11 @@ Theme* Theme::create(const char* url)
                         textColor.set(normal->getTextColor());
                     }
 
-                    const char* fontPath = innerSpace->getString("font");
                     Font* font = NULL;
-                    if (fontPath)
+                    std::string fontPath;
+                    if (innerSpace->getPath("font", &fontPath))
                     {
-                        font = Font::create(fontPath);
+                        font = Font::create(fontPath.c_str());
                     }
                     if (!font)
                     {

+ 12 - 2
gameplay/src/VerticalLayout.cpp

@@ -4,7 +4,7 @@
 namespace gameplay
 {
 
-VerticalLayout::VerticalLayout() : _bottomToTop(false)
+VerticalLayout::VerticalLayout() : _bottomToTop(false), _spacing(0)
 {
 }
 
@@ -32,6 +32,16 @@ Layout::Type VerticalLayout::getType()
     return Layout::LAYOUT_VERTICAL;
 }
 
+int VerticalLayout::getSpacing() const
+{
+    return _spacing;
+}
+
+void VerticalLayout::setSpacing(int spacing)
+{
+    _spacing = spacing;
+}
+
 void VerticalLayout::update(const Container* container, const Vector2& offset)
 {
     GP_ASSERT(container);
@@ -75,7 +85,7 @@ void VerticalLayout::update(const Container* container, const Vector2& offset)
             control->setPosition(margin.left, yPosition);
             control->update(container, offset);
 
-            yPosition += bounds.height + margin.bottom;
+            yPosition += bounds.height + margin.bottom + _spacing;
         }
 
         i += iter;

+ 19 - 0
gameplay/src/VerticalLayout.h

@@ -40,6 +40,20 @@ public:
      */
     Layout::Type getType();
 
+    /**
+     * Returns the vertical spacing between controls in the layout.
+     *
+     * @return The vertical spacing between controls.
+     */
+    int getSpacing() const;
+
+    /**
+     * Sets the vertical spacing to add between controls in the layout.
+     *
+     * @param spacing The vertical spacing between controls.
+     */
+    void setSpacing(int spacing);
+
 protected:
 
     /**
@@ -69,6 +83,11 @@ protected:
      */
     bool _bottomToTop;
 
+    /**
+     * Spacing between controls in the layout.
+     */
+    int _spacing;
+
 private:
 
     /**

+ 72 - 0
gameplay/src/lua/lua_Bundle.cpp

@@ -22,6 +22,8 @@ void luaRegister_Bundle()
         {"getObjectCount", lua_Bundle_getObjectCount},
         {"getObjectId", lua_Bundle_getObjectId},
         {"getRefCount", lua_Bundle_getRefCount},
+        {"getVersionMajor", lua_Bundle_getVersionMajor},
+        {"getVersionMinor", lua_Bundle_getVersionMinor},
         {"loadFont", lua_Bundle_loadFont},
         {"loadMesh", lua_Bundle_loadMesh},
         {"loadNode", lua_Bundle_loadNode},
@@ -264,6 +266,76 @@ int lua_Bundle_getRefCount(lua_State* state)
     return 0;
 }
 
+int lua_Bundle_getVersionMajor(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Bundle* instance = getInstance(state);
+                unsigned int result = instance->getVersionMajor();
+
+                // Push the return value onto the stack.
+                lua_pushunsigned(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Bundle_getVersionMajor - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Bundle_getVersionMinor(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Bundle* instance = getInstance(state);
+                unsigned int result = instance->getVersionMinor();
+
+                // Push the return value onto the stack.
+                lua_pushunsigned(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Bundle_getVersionMinor - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Bundle_loadFont(lua_State* state)
 {
     // Get the number of parameters.

+ 2 - 0
gameplay/src/lua/lua_Bundle.h

@@ -11,6 +11,8 @@ int lua_Bundle_contains(lua_State* state);
 int lua_Bundle_getObjectCount(lua_State* state);
 int lua_Bundle_getObjectId(lua_State* state);
 int lua_Bundle_getRefCount(lua_State* state);
+int lua_Bundle_getVersionMajor(lua_State* state);
+int lua_Bundle_getVersionMinor(lua_State* state);
 int lua_Bundle_loadFont(lua_State* state);
 int lua_Bundle_loadMesh(lua_State* state);
 int lua_Bundle_loadNode(lua_State* state);

+ 367 - 24
gameplay/src/lua/lua_Button.cpp

@@ -14,6 +14,7 @@
 #include "ScriptController.h"
 #include "ScriptTarget.h"
 #include "lua_ControlAlignment.h"
+#include "lua_ControlAutoSize.h"
 #include "lua_ControlListenerEventType.h"
 #include "lua_ControlState.h"
 #include "lua_CurveInterpolationType.h"
@@ -74,7 +75,11 @@ void luaRegister_Button()
         {"getZIndex", lua_Button_getZIndex},
         {"isContainer", lua_Button_isContainer},
         {"isEnabled", lua_Button_isEnabled},
+        {"isHeightPercentage", lua_Button_isHeightPercentage},
         {"isVisible", lua_Button_isVisible},
+        {"isWidthPercentage", lua_Button_isWidthPercentage},
+        {"isXPercentage", lua_Button_isXPercentage},
+        {"isYPercentage", lua_Button_isYPercentage},
         {"release", lua_Button_release},
         {"removeListener", lua_Button_removeListener},
         {"removeScriptCallback", lua_Button_removeScriptCallback},
@@ -109,6 +114,8 @@ void luaRegister_Button()
         {"setTextRightToLeft", lua_Button_setTextRightToLeft},
         {"setVisible", lua_Button_setVisible},
         {"setWidth", lua_Button_setWidth},
+        {"setX", lua_Button_setX},
+        {"setY", lua_Button_setY},
         {"setZIndex", lua_Button_setZIndex},
         {NULL, NULL}
     };
@@ -932,10 +939,10 @@ int lua_Button_getAutoHeight(lua_State* state)
             if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
                 Button* instance = getInstance(state);
-                bool result = instance->getAutoHeight();
+                Control::AutoSize result = instance->getAutoHeight();
 
                 // Push the return value onto the stack.
-                lua_pushboolean(state, result);
+                lua_pushstring(state, lua_stringFromEnum_ControlAutoSize(result));
 
                 return 1;
             }
@@ -967,10 +974,10 @@ int lua_Button_getAutoWidth(lua_State* state)
             if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
                 Button* instance = getInstance(state);
-                bool result = instance->getAutoWidth();
+                Control::AutoSize result = instance->getAutoWidth();
 
                 // Push the return value onto the stack.
-                lua_pushboolean(state, result);
+                lua_pushstring(state, lua_stringFromEnum_ControlAutoSize(result));
 
                 return 1;
             }
@@ -2602,6 +2609,41 @@ int lua_Button_isEnabled(lua_State* state)
     return 0;
 }
 
+int lua_Button_isHeightPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Button* instance = getInstance(state);
+                bool result = instance->isHeightPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Button_isHeightPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Button_isVisible(lua_State* state)
 {
     // Get the number of parameters.
@@ -2637,6 +2679,111 @@ int lua_Button_isVisible(lua_State* state)
     return 0;
 }
 
+int lua_Button_isWidthPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Button* instance = getInstance(state);
+                bool result = instance->isWidthPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Button_isWidthPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Button_isXPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Button* instance = getInstance(state);
+                bool result = instance->isXPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Button_isXPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Button_isYPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Button* instance = getInstance(state);
+                bool result = instance->isYPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Button_isYPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Button_release(lua_State* state)
 {
     // Get the number of parameters.
@@ -2875,17 +3022,35 @@ int lua_Button_setAutoHeight(lua_State* state)
     {
         case 2:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                lua_type(state, 2) == LUA_TBOOLEAN)
+            do
             {
-                // Get parameter 1 off the stack.
-                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    lua_type(state, 2) == LUA_TBOOLEAN)
+                {
+                    // Get parameter 1 off the stack.
+                    bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
 
-                Button* instance = getInstance(state);
-                instance->setAutoHeight(param1);
-                
-                return 0;
-            }
+                    Button* instance = getInstance(state);
+                    instance->setAutoHeight(param1);
+                    
+                    return 0;
+                }
+            } while (0);
+
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
+                {
+                    // Get parameter 1 off the stack.
+                    Control::AutoSize param1 = (Control::AutoSize)lua_enumFromString_ControlAutoSize(luaL_checkstring(state, 2));
+
+                    Button* instance = getInstance(state);
+                    instance->setAutoHeight(param1);
+                    
+                    return 0;
+                }
+            } while (0);
 
             lua_pushstring(state, "lua_Button_setAutoHeight - Failed to match the given parameters to a valid function signature.");
             lua_error(state);
@@ -2911,17 +3076,35 @@ int lua_Button_setAutoWidth(lua_State* state)
     {
         case 2:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                lua_type(state, 2) == LUA_TBOOLEAN)
+            do
             {
-                // Get parameter 1 off the stack.
-                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    lua_type(state, 2) == LUA_TBOOLEAN)
+                {
+                    // Get parameter 1 off the stack.
+                    bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
 
-                Button* instance = getInstance(state);
-                instance->setAutoWidth(param1);
-                
-                return 0;
-            }
+                    Button* instance = getInstance(state);
+                    instance->setAutoWidth(param1);
+                    
+                    return 0;
+                }
+            } while (0);
+
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
+                {
+                    // Get parameter 1 off the stack.
+                    Control::AutoSize param1 = (Control::AutoSize)lua_enumFromString_ControlAutoSize(luaL_checkstring(state, 2));
+
+                    Button* instance = getInstance(state);
+                    instance->setAutoWidth(param1);
+                    
+                    return 0;
+                }
+            } while (0);
 
             lua_pushstring(state, "lua_Button_setAutoWidth - Failed to match the given parameters to a valid function signature.");
             lua_error(state);
@@ -3415,9 +3598,31 @@ int lua_Button_setHeight(lua_State* state)
             lua_error(state);
             break;
         }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                Button* instance = getInstance(state);
+                instance->setHeight(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Button_setHeight - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
             lua_error(state);
             break;
         }
@@ -4317,9 +4522,147 @@ int lua_Button_setWidth(lua_State* state)
             lua_error(state);
             break;
         }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                Button* instance = getInstance(state);
+                instance->setWidth(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Button_setWidth - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Button_setX(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                Button* instance = getInstance(state);
+                instance->setX(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Button_setX - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                Button* instance = getInstance(state);
+                instance->setX(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Button_setX - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Button_setY(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                Button* instance = getInstance(state);
+                instance->setY(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Button_setY - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                Button* instance = getInstance(state);
+                instance->setY(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Button_setY - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
             lua_error(state);
             break;
         }

+ 6 - 0
gameplay/src/lua/lua_Button.h

@@ -54,7 +54,11 @@ int lua_Button_getY(lua_State* state);
 int lua_Button_getZIndex(lua_State* state);
 int lua_Button_isContainer(lua_State* state);
 int lua_Button_isEnabled(lua_State* state);
+int lua_Button_isHeightPercentage(lua_State* state);
 int lua_Button_isVisible(lua_State* state);
+int lua_Button_isWidthPercentage(lua_State* state);
+int lua_Button_isXPercentage(lua_State* state);
+int lua_Button_isYPercentage(lua_State* state);
 int lua_Button_release(lua_State* state);
 int lua_Button_removeListener(lua_State* state);
 int lua_Button_removeScriptCallback(lua_State* state);
@@ -89,6 +93,8 @@ int lua_Button_setTextColor(lua_State* state);
 int lua_Button_setTextRightToLeft(lua_State* state);
 int lua_Button_setVisible(lua_State* state);
 int lua_Button_setWidth(lua_State* state);
+int lua_Button_setX(lua_State* state);
+int lua_Button_setY(lua_State* state);
 int lua_Button_setZIndex(lua_State* state);
 int lua_Button_static_ANIMATE_OPACITY(lua_State* state);
 int lua_Button_static_ANIMATE_POSITION(lua_State* state);

+ 367 - 24
gameplay/src/lua/lua_CheckBox.cpp

@@ -15,6 +15,7 @@
 #include "ScriptController.h"
 #include "ScriptTarget.h"
 #include "lua_ControlAlignment.h"
+#include "lua_ControlAutoSize.h"
 #include "lua_ControlListenerEventType.h"
 #include "lua_ControlState.h"
 #include "lua_CurveInterpolationType.h"
@@ -78,7 +79,11 @@ void luaRegister_CheckBox()
         {"isChecked", lua_CheckBox_isChecked},
         {"isContainer", lua_CheckBox_isContainer},
         {"isEnabled", lua_CheckBox_isEnabled},
+        {"isHeightPercentage", lua_CheckBox_isHeightPercentage},
         {"isVisible", lua_CheckBox_isVisible},
+        {"isWidthPercentage", lua_CheckBox_isWidthPercentage},
+        {"isXPercentage", lua_CheckBox_isXPercentage},
+        {"isYPercentage", lua_CheckBox_isYPercentage},
         {"release", lua_CheckBox_release},
         {"removeListener", lua_CheckBox_removeListener},
         {"removeScriptCallback", lua_CheckBox_removeScriptCallback},
@@ -115,6 +120,8 @@ void luaRegister_CheckBox()
         {"setTextRightToLeft", lua_CheckBox_setTextRightToLeft},
         {"setVisible", lua_CheckBox_setVisible},
         {"setWidth", lua_CheckBox_setWidth},
+        {"setX", lua_CheckBox_setX},
+        {"setY", lua_CheckBox_setY},
         {"setZIndex", lua_CheckBox_setZIndex},
         {NULL, NULL}
     };
@@ -938,10 +945,10 @@ int lua_CheckBox_getAutoHeight(lua_State* state)
             if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
                 CheckBox* instance = getInstance(state);
-                bool result = instance->getAutoHeight();
+                Control::AutoSize result = instance->getAutoHeight();
 
                 // Push the return value onto the stack.
-                lua_pushboolean(state, result);
+                lua_pushstring(state, lua_stringFromEnum_ControlAutoSize(result));
 
                 return 1;
             }
@@ -973,10 +980,10 @@ int lua_CheckBox_getAutoWidth(lua_State* state)
             if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
                 CheckBox* instance = getInstance(state);
-                bool result = instance->getAutoWidth();
+                Control::AutoSize result = instance->getAutoWidth();
 
                 // Push the return value onto the stack.
-                lua_pushboolean(state, result);
+                lua_pushstring(state, lua_stringFromEnum_ControlAutoSize(result));
 
                 return 1;
             }
@@ -2722,6 +2729,41 @@ int lua_CheckBox_isEnabled(lua_State* state)
     return 0;
 }
 
+int lua_CheckBox_isHeightPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                CheckBox* instance = getInstance(state);
+                bool result = instance->isHeightPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_CheckBox_isHeightPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_CheckBox_isVisible(lua_State* state)
 {
     // Get the number of parameters.
@@ -2757,6 +2799,111 @@ int lua_CheckBox_isVisible(lua_State* state)
     return 0;
 }
 
+int lua_CheckBox_isWidthPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                CheckBox* instance = getInstance(state);
+                bool result = instance->isWidthPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_CheckBox_isWidthPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_CheckBox_isXPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                CheckBox* instance = getInstance(state);
+                bool result = instance->isXPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_CheckBox_isXPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_CheckBox_isYPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                CheckBox* instance = getInstance(state);
+                bool result = instance->isYPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_CheckBox_isYPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_CheckBox_release(lua_State* state)
 {
     // Get the number of parameters.
@@ -2995,17 +3142,35 @@ int lua_CheckBox_setAutoHeight(lua_State* state)
     {
         case 2:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                lua_type(state, 2) == LUA_TBOOLEAN)
+            do
             {
-                // Get parameter 1 off the stack.
-                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    lua_type(state, 2) == LUA_TBOOLEAN)
+                {
+                    // Get parameter 1 off the stack.
+                    bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
 
-                CheckBox* instance = getInstance(state);
-                instance->setAutoHeight(param1);
-                
-                return 0;
-            }
+                    CheckBox* instance = getInstance(state);
+                    instance->setAutoHeight(param1);
+                    
+                    return 0;
+                }
+            } while (0);
+
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
+                {
+                    // Get parameter 1 off the stack.
+                    Control::AutoSize param1 = (Control::AutoSize)lua_enumFromString_ControlAutoSize(luaL_checkstring(state, 2));
+
+                    CheckBox* instance = getInstance(state);
+                    instance->setAutoHeight(param1);
+                    
+                    return 0;
+                }
+            } while (0);
 
             lua_pushstring(state, "lua_CheckBox_setAutoHeight - Failed to match the given parameters to a valid function signature.");
             lua_error(state);
@@ -3031,17 +3196,35 @@ int lua_CheckBox_setAutoWidth(lua_State* state)
     {
         case 2:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                lua_type(state, 2) == LUA_TBOOLEAN)
+            do
             {
-                // Get parameter 1 off the stack.
-                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    lua_type(state, 2) == LUA_TBOOLEAN)
+                {
+                    // Get parameter 1 off the stack.
+                    bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
 
-                CheckBox* instance = getInstance(state);
-                instance->setAutoWidth(param1);
-                
-                return 0;
-            }
+                    CheckBox* instance = getInstance(state);
+                    instance->setAutoWidth(param1);
+                    
+                    return 0;
+                }
+            } while (0);
+
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
+                {
+                    // Get parameter 1 off the stack.
+                    Control::AutoSize param1 = (Control::AutoSize)lua_enumFromString_ControlAutoSize(luaL_checkstring(state, 2));
+
+                    CheckBox* instance = getInstance(state);
+                    instance->setAutoWidth(param1);
+                    
+                    return 0;
+                }
+            } while (0);
 
             lua_pushstring(state, "lua_CheckBox_setAutoWidth - Failed to match the given parameters to a valid function signature.");
             lua_error(state);
@@ -3571,9 +3754,31 @@ int lua_CheckBox_setHeight(lua_State* state)
             lua_error(state);
             break;
         }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                CheckBox* instance = getInstance(state);
+                instance->setHeight(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_CheckBox_setHeight - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
             lua_error(state);
             break;
         }
@@ -4513,9 +4718,147 @@ int lua_CheckBox_setWidth(lua_State* state)
             lua_error(state);
             break;
         }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                CheckBox* instance = getInstance(state);
+                instance->setWidth(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_CheckBox_setWidth - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_CheckBox_setX(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                CheckBox* instance = getInstance(state);
+                instance->setX(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_CheckBox_setX - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                CheckBox* instance = getInstance(state);
+                instance->setX(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_CheckBox_setX - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_CheckBox_setY(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                CheckBox* instance = getInstance(state);
+                instance->setY(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_CheckBox_setY - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                CheckBox* instance = getInstance(state);
+                instance->setY(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_CheckBox_setY - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
             lua_error(state);
             break;
         }

+ 6 - 0
gameplay/src/lua/lua_CheckBox.h

@@ -57,7 +57,11 @@ int lua_CheckBox_getZIndex(lua_State* state);
 int lua_CheckBox_isChecked(lua_State* state);
 int lua_CheckBox_isContainer(lua_State* state);
 int lua_CheckBox_isEnabled(lua_State* state);
+int lua_CheckBox_isHeightPercentage(lua_State* state);
 int lua_CheckBox_isVisible(lua_State* state);
+int lua_CheckBox_isWidthPercentage(lua_State* state);
+int lua_CheckBox_isXPercentage(lua_State* state);
+int lua_CheckBox_isYPercentage(lua_State* state);
 int lua_CheckBox_release(lua_State* state);
 int lua_CheckBox_removeListener(lua_State* state);
 int lua_CheckBox_removeScriptCallback(lua_State* state);
@@ -94,6 +98,8 @@ int lua_CheckBox_setTextColor(lua_State* state);
 int lua_CheckBox_setTextRightToLeft(lua_State* state);
 int lua_CheckBox_setVisible(lua_State* state);
 int lua_CheckBox_setWidth(lua_State* state);
+int lua_CheckBox_setX(lua_State* state);
+int lua_CheckBox_setY(lua_State* state);
 int lua_CheckBox_setZIndex(lua_State* state);
 int lua_CheckBox_static_ANIMATE_OPACITY(lua_State* state);
 int lua_CheckBox_static_ANIMATE_POSITION(lua_State* state);

+ 369 - 26
gameplay/src/lua/lua_Container.cpp

@@ -25,6 +25,7 @@
 #include "VerticalLayout.h"
 #include "lua_ContainerScroll.h"
 #include "lua_ControlAlignment.h"
+#include "lua_ControlAutoSize.h"
 #include "lua_ControlListenerEventType.h"
 #include "lua_ControlState.h"
 #include "lua_CurveInterpolationType.h"
@@ -95,9 +96,13 @@ void luaRegister_Container()
         {"insertControl", lua_Container_insertControl},
         {"isContainer", lua_Container_isContainer},
         {"isEnabled", lua_Container_isEnabled},
+        {"isHeightPercentage", lua_Container_isHeightPercentage},
         {"isScrollBarsAutoHide", lua_Container_isScrollBarsAutoHide},
         {"isScrolling", lua_Container_isScrolling},
         {"isVisible", lua_Container_isVisible},
+        {"isWidthPercentage", lua_Container_isWidthPercentage},
+        {"isXPercentage", lua_Container_isXPercentage},
+        {"isYPercentage", lua_Container_isYPercentage},
         {"release", lua_Container_release},
         {"removeControl", lua_Container_removeControl},
         {"removeListener", lua_Container_removeListener},
@@ -138,6 +143,8 @@ void luaRegister_Container()
         {"setTextRightToLeft", lua_Container_setTextRightToLeft},
         {"setVisible", lua_Container_setVisible},
         {"setWidth", lua_Container_setWidth},
+        {"setX", lua_Container_setX},
+        {"setY", lua_Container_setY},
         {"setZIndex", lua_Container_setZIndex},
         {NULL, NULL}
     };
@@ -1007,10 +1014,10 @@ int lua_Container_getAutoHeight(lua_State* state)
             if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
                 Container* instance = getInstance(state);
-                bool result = instance->getAutoHeight();
+                Control::AutoSize result = instance->getAutoHeight();
 
                 // Push the return value onto the stack.
-                lua_pushboolean(state, result);
+                lua_pushstring(state, lua_stringFromEnum_ControlAutoSize(result));
 
                 return 1;
             }
@@ -1042,10 +1049,10 @@ int lua_Container_getAutoWidth(lua_State* state)
             if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
                 Container* instance = getInstance(state);
-                bool result = instance->getAutoWidth();
+                Control::AutoSize result = instance->getAutoWidth();
 
                 // Push the return value onto the stack.
-                lua_pushboolean(state, result);
+                lua_pushstring(state, lua_stringFromEnum_ControlAutoSize(result));
 
                 return 1;
             }
@@ -2192,7 +2199,7 @@ int lua_Container_getScrollPosition(lua_State* state)
                 void* returnPtr = (void*)&(instance->getScrollPosition());
                 if (returnPtr)
                 {
-                    ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
+                    gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
                     object->instance = returnPtr;
                     object->owns = false;
                     luaL_getmetatable(state, "Vector2");
@@ -3029,6 +3036,41 @@ int lua_Container_isEnabled(lua_State* state)
     return 0;
 }
 
+int lua_Container_isHeightPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Container* instance = getInstance(state);
+                bool result = instance->isHeightPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Container_isHeightPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Container_isScrollBarsAutoHide(lua_State* state)
 {
     // Get the number of parameters.
@@ -3134,6 +3176,111 @@ int lua_Container_isVisible(lua_State* state)
     return 0;
 }
 
+int lua_Container_isWidthPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Container* instance = getInstance(state);
+                bool result = instance->isWidthPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Container_isWidthPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Container_isXPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Container* instance = getInstance(state);
+                bool result = instance->isXPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Container_isXPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Container_isYPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Container* instance = getInstance(state);
+                bool result = instance->isYPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Container_isYPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Container_release(lua_State* state)
 {
     // Get the number of parameters.
@@ -3444,17 +3591,35 @@ int lua_Container_setAutoHeight(lua_State* state)
     {
         case 2:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                lua_type(state, 2) == LUA_TBOOLEAN)
+            do
             {
-                // Get parameter 1 off the stack.
-                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    lua_type(state, 2) == LUA_TBOOLEAN)
+                {
+                    // Get parameter 1 off the stack.
+                    bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
 
-                Container* instance = getInstance(state);
-                instance->setAutoHeight(param1);
-                
-                return 0;
-            }
+                    Container* instance = getInstance(state);
+                    instance->setAutoHeight(param1);
+                    
+                    return 0;
+                }
+            } while (0);
+
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
+                {
+                    // Get parameter 1 off the stack.
+                    Control::AutoSize param1 = (Control::AutoSize)lua_enumFromString_ControlAutoSize(luaL_checkstring(state, 2));
+
+                    Container* instance = getInstance(state);
+                    instance->setAutoHeight(param1);
+                    
+                    return 0;
+                }
+            } while (0);
 
             lua_pushstring(state, "lua_Container_setAutoHeight - Failed to match the given parameters to a valid function signature.");
             lua_error(state);
@@ -3480,17 +3645,35 @@ int lua_Container_setAutoWidth(lua_State* state)
     {
         case 2:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                lua_type(state, 2) == LUA_TBOOLEAN)
+            do
             {
-                // Get parameter 1 off the stack.
-                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    lua_type(state, 2) == LUA_TBOOLEAN)
+                {
+                    // Get parameter 1 off the stack.
+                    bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
 
-                Container* instance = getInstance(state);
-                instance->setAutoWidth(param1);
-                
-                return 0;
-            }
+                    Container* instance = getInstance(state);
+                    instance->setAutoWidth(param1);
+                    
+                    return 0;
+                }
+            } while (0);
+
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
+                {
+                    // Get parameter 1 off the stack.
+                    Control::AutoSize param1 = (Control::AutoSize)lua_enumFromString_ControlAutoSize(luaL_checkstring(state, 2));
+
+                    Container* instance = getInstance(state);
+                    instance->setAutoWidth(param1);
+                    
+                    return 0;
+                }
+            } while (0);
 
             lua_pushstring(state, "lua_Container_setAutoWidth - Failed to match the given parameters to a valid function signature.");
             lua_error(state);
@@ -3984,9 +4167,31 @@ int lua_Container_setHeight(lua_State* state)
             lua_error(state);
             break;
         }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                Container* instance = getInstance(state);
+                instance->setHeight(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Container_setHeight - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
             lua_error(state);
             break;
         }
@@ -4431,7 +4636,7 @@ int lua_Container_setScrollPosition(lua_State* state)
             {
                 // Get parameter 1 off the stack.
                 bool param1Valid;
-                ScriptUtil::LuaArray<Vector2> param1 = ScriptUtil::getObjectPointer<Vector2>(2, "Vector2", true, &param1Valid);
+                gameplay::ScriptUtil::LuaArray<Vector2> param1 = gameplay::ScriptUtil::getObjectPointer<Vector2>(2, "Vector2", true, &param1Valid);
                 if (!param1Valid)
                 {
                     lua_pushstring(state, "Failed to convert parameter 1 to type 'Vector2'.");
@@ -5072,9 +5277,147 @@ int lua_Container_setWidth(lua_State* state)
             lua_error(state);
             break;
         }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                Container* instance = getInstance(state);
+                instance->setWidth(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Container_setWidth - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Container_setX(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                Container* instance = getInstance(state);
+                instance->setX(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Container_setX - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                Container* instance = getInstance(state);
+                instance->setX(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Container_setX - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Container_setY(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                Container* instance = getInstance(state);
+                instance->setY(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Container_setY - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                Container* instance = getInstance(state);
+                instance->setY(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Container_setY - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
             lua_error(state);
             break;
         }

+ 6 - 0
gameplay/src/lua/lua_Container.h

@@ -63,9 +63,13 @@ int lua_Container_getZIndex(lua_State* state);
 int lua_Container_insertControl(lua_State* state);
 int lua_Container_isContainer(lua_State* state);
 int lua_Container_isEnabled(lua_State* state);
+int lua_Container_isHeightPercentage(lua_State* state);
 int lua_Container_isScrollBarsAutoHide(lua_State* state);
 int lua_Container_isScrolling(lua_State* state);
 int lua_Container_isVisible(lua_State* state);
+int lua_Container_isWidthPercentage(lua_State* state);
+int lua_Container_isXPercentage(lua_State* state);
+int lua_Container_isYPercentage(lua_State* state);
 int lua_Container_release(lua_State* state);
 int lua_Container_removeControl(lua_State* state);
 int lua_Container_removeListener(lua_State* state);
@@ -106,6 +110,8 @@ int lua_Container_setTextColor(lua_State* state);
 int lua_Container_setTextRightToLeft(lua_State* state);
 int lua_Container_setVisible(lua_State* state);
 int lua_Container_setWidth(lua_State* state);
+int lua_Container_setX(lua_State* state);
+int lua_Container_setY(lua_State* state);
 int lua_Container_setZIndex(lua_State* state);
 int lua_Container_static_ANIMATE_OPACITY(lua_State* state);
 int lua_Container_static_ANIMATE_POSITION(lua_State* state);

+ 367 - 24
gameplay/src/lua/lua_Control.cpp

@@ -11,6 +11,7 @@
 #include "ScriptController.h"
 #include "ScriptTarget.h"
 #include "lua_ControlAlignment.h"
+#include "lua_ControlAutoSize.h"
 #include "lua_ControlListenerEventType.h"
 #include "lua_ControlState.h"
 #include "lua_CurveInterpolationType.h"
@@ -71,7 +72,11 @@ void luaRegister_Control()
         {"getZIndex", lua_Control_getZIndex},
         {"isContainer", lua_Control_isContainer},
         {"isEnabled", lua_Control_isEnabled},
+        {"isHeightPercentage", lua_Control_isHeightPercentage},
         {"isVisible", lua_Control_isVisible},
+        {"isWidthPercentage", lua_Control_isWidthPercentage},
+        {"isXPercentage", lua_Control_isXPercentage},
+        {"isYPercentage", lua_Control_isYPercentage},
         {"release", lua_Control_release},
         {"removeListener", lua_Control_removeListener},
         {"removeScriptCallback", lua_Control_removeScriptCallback},
@@ -105,6 +110,8 @@ void luaRegister_Control()
         {"setTextRightToLeft", lua_Control_setTextRightToLeft},
         {"setVisible", lua_Control_setVisible},
         {"setWidth", lua_Control_setWidth},
+        {"setX", lua_Control_setX},
+        {"setY", lua_Control_setY},
         {"setZIndex", lua_Control_setZIndex},
         {NULL, NULL}
     };
@@ -927,10 +934,10 @@ int lua_Control_getAutoHeight(lua_State* state)
             if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
                 Control* instance = getInstance(state);
-                bool result = instance->getAutoHeight();
+                Control::AutoSize result = instance->getAutoHeight();
 
                 // Push the return value onto the stack.
-                lua_pushboolean(state, result);
+                lua_pushstring(state, lua_stringFromEnum_ControlAutoSize(result));
 
                 return 1;
             }
@@ -962,10 +969,10 @@ int lua_Control_getAutoWidth(lua_State* state)
             if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
                 Control* instance = getInstance(state);
-                bool result = instance->getAutoWidth();
+                Control::AutoSize result = instance->getAutoWidth();
 
                 // Push the return value onto the stack.
-                lua_pushboolean(state, result);
+                lua_pushstring(state, lua_stringFromEnum_ControlAutoSize(result));
 
                 return 1;
             }
@@ -2597,6 +2604,41 @@ int lua_Control_isEnabled(lua_State* state)
     return 0;
 }
 
+int lua_Control_isHeightPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Control* instance = getInstance(state);
+                bool result = instance->isHeightPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Control_isHeightPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Control_isVisible(lua_State* state)
 {
     // Get the number of parameters.
@@ -2632,6 +2674,111 @@ int lua_Control_isVisible(lua_State* state)
     return 0;
 }
 
+int lua_Control_isWidthPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Control* instance = getInstance(state);
+                bool result = instance->isWidthPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Control_isWidthPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Control_isXPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Control* instance = getInstance(state);
+                bool result = instance->isXPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Control_isXPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Control_isYPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Control* instance = getInstance(state);
+                bool result = instance->isYPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Control_isYPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Control_release(lua_State* state)
 {
     // Get the number of parameters.
@@ -2870,17 +3017,35 @@ int lua_Control_setAutoHeight(lua_State* state)
     {
         case 2:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                lua_type(state, 2) == LUA_TBOOLEAN)
+            do
             {
-                // Get parameter 1 off the stack.
-                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    lua_type(state, 2) == LUA_TBOOLEAN)
+                {
+                    // Get parameter 1 off the stack.
+                    bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
 
-                Control* instance = getInstance(state);
-                instance->setAutoHeight(param1);
-                
-                return 0;
-            }
+                    Control* instance = getInstance(state);
+                    instance->setAutoHeight(param1);
+                    
+                    return 0;
+                }
+            } while (0);
+
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
+                {
+                    // Get parameter 1 off the stack.
+                    Control::AutoSize param1 = (Control::AutoSize)lua_enumFromString_ControlAutoSize(luaL_checkstring(state, 2));
+
+                    Control* instance = getInstance(state);
+                    instance->setAutoHeight(param1);
+                    
+                    return 0;
+                }
+            } while (0);
 
             lua_pushstring(state, "lua_Control_setAutoHeight - Failed to match the given parameters to a valid function signature.");
             lua_error(state);
@@ -2906,17 +3071,35 @@ int lua_Control_setAutoWidth(lua_State* state)
     {
         case 2:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                lua_type(state, 2) == LUA_TBOOLEAN)
+            do
             {
-                // Get parameter 1 off the stack.
-                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    lua_type(state, 2) == LUA_TBOOLEAN)
+                {
+                    // Get parameter 1 off the stack.
+                    bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
 
-                Control* instance = getInstance(state);
-                instance->setAutoWidth(param1);
-                
-                return 0;
-            }
+                    Control* instance = getInstance(state);
+                    instance->setAutoWidth(param1);
+                    
+                    return 0;
+                }
+            } while (0);
+
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
+                {
+                    // Get parameter 1 off the stack.
+                    Control::AutoSize param1 = (Control::AutoSize)lua_enumFromString_ControlAutoSize(luaL_checkstring(state, 2));
+
+                    Control* instance = getInstance(state);
+                    instance->setAutoWidth(param1);
+                    
+                    return 0;
+                }
+            } while (0);
 
             lua_pushstring(state, "lua_Control_setAutoWidth - Failed to match the given parameters to a valid function signature.");
             lua_error(state);
@@ -3410,9 +3593,31 @@ int lua_Control_setHeight(lua_State* state)
             lua_error(state);
             break;
         }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                Control* instance = getInstance(state);
+                instance->setHeight(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Control_setHeight - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
             lua_error(state);
             break;
         }
@@ -4276,9 +4481,147 @@ int lua_Control_setWidth(lua_State* state)
             lua_error(state);
             break;
         }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                Control* instance = getInstance(state);
+                instance->setWidth(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Control_setWidth - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Control_setX(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                Control* instance = getInstance(state);
+                instance->setX(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Control_setX - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                Control* instance = getInstance(state);
+                instance->setX(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Control_setX - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Control_setY(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                Control* instance = getInstance(state);
+                instance->setY(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Control_setY - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                Control* instance = getInstance(state);
+                instance->setY(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Control_setY - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
             lua_error(state);
             break;
         }

+ 6 - 0
gameplay/src/lua/lua_Control.h

@@ -54,7 +54,11 @@ int lua_Control_getY(lua_State* state);
 int lua_Control_getZIndex(lua_State* state);
 int lua_Control_isContainer(lua_State* state);
 int lua_Control_isEnabled(lua_State* state);
+int lua_Control_isHeightPercentage(lua_State* state);
 int lua_Control_isVisible(lua_State* state);
+int lua_Control_isWidthPercentage(lua_State* state);
+int lua_Control_isXPercentage(lua_State* state);
+int lua_Control_isYPercentage(lua_State* state);
 int lua_Control_release(lua_State* state);
 int lua_Control_removeListener(lua_State* state);
 int lua_Control_removeScriptCallback(lua_State* state);
@@ -88,6 +92,8 @@ int lua_Control_setTextColor(lua_State* state);
 int lua_Control_setTextRightToLeft(lua_State* state);
 int lua_Control_setVisible(lua_State* state);
 int lua_Control_setWidth(lua_State* state);
+int lua_Control_setX(lua_State* state);
+int lua_Control_setY(lua_State* state);
 int lua_Control_setZIndex(lua_State* state);
 int lua_Control_static_ANIMATE_OPACITY(lua_State* state);
 int lua_Control_static_ANIMATE_POSITION(lua_State* state);

+ 36 - 0
gameplay/src/lua/lua_ControlAutoSize.cpp

@@ -0,0 +1,36 @@
+#include "Base.h"
+#include "lua_ControlAutoSize.h"
+
+namespace gameplay
+{
+
+static const char* enumStringEmpty = "";
+
+static const char* luaEnumString_ControlAutoSize_AUTO_SIZE_NONE = "AUTO_SIZE_NONE";
+static const char* luaEnumString_ControlAutoSize_AUTO_SIZE_STRETCH = "AUTO_SIZE_STRETCH";
+static const char* luaEnumString_ControlAutoSize_AUTO_SIZE_FIT = "AUTO_SIZE_FIT";
+
+Control::AutoSize lua_enumFromString_ControlAutoSize(const char* s)
+{
+    if (strcmp(s, luaEnumString_ControlAutoSize_AUTO_SIZE_NONE) == 0)
+        return Control::AUTO_SIZE_NONE;
+    if (strcmp(s, luaEnumString_ControlAutoSize_AUTO_SIZE_STRETCH) == 0)
+        return Control::AUTO_SIZE_STRETCH;
+    if (strcmp(s, luaEnumString_ControlAutoSize_AUTO_SIZE_FIT) == 0)
+        return Control::AUTO_SIZE_FIT;
+    return Control::AUTO_SIZE_NONE;
+}
+
+const char* lua_stringFromEnum_ControlAutoSize(Control::AutoSize e)
+{
+    if (e == Control::AUTO_SIZE_NONE)
+        return luaEnumString_ControlAutoSize_AUTO_SIZE_NONE;
+    if (e == Control::AUTO_SIZE_STRETCH)
+        return luaEnumString_ControlAutoSize_AUTO_SIZE_STRETCH;
+    if (e == Control::AUTO_SIZE_FIT)
+        return luaEnumString_ControlAutoSize_AUTO_SIZE_FIT;
+    return enumStringEmpty;
+}
+
+}
+

+ 15 - 0
gameplay/src/lua/lua_ControlAutoSize.h

@@ -0,0 +1,15 @@
+#ifndef LUA_CONTROLAUTOSIZE_H_
+#define LUA_CONTROLAUTOSIZE_H_
+
+#include "Control.h"
+
+namespace gameplay
+{
+
+// Lua bindings for enum conversion functions for Control::AutoSize.
+Control::AutoSize lua_enumFromString_ControlAutoSize(const char* s);
+const char* lua_stringFromEnum_ControlAutoSize(Control::AutoSize e);
+
+}
+
+#endif

+ 1 - 0
gameplay/src/lua/lua_ControlListener.cpp

@@ -11,6 +11,7 @@
 #include "ScriptController.h"
 #include "ScriptTarget.h"
 #include "lua_ControlAlignment.h"
+#include "lua_ControlAutoSize.h"
 #include "lua_ControlListenerEventType.h"
 #include "lua_ControlState.h"
 #include "lua_CurveInterpolationType.h"

+ 113 - 0
gameplay/src/lua/lua_FlowLayout.cpp

@@ -18,9 +18,12 @@ void luaRegister_FlowLayout()
     const luaL_Reg lua_members[] = 
     {
         {"addRef", lua_FlowLayout_addRef},
+        {"getHorizontalSpacing", lua_FlowLayout_getHorizontalSpacing},
         {"getRefCount", lua_FlowLayout_getRefCount},
         {"getType", lua_FlowLayout_getType},
+        {"getVerticalSpacing", lua_FlowLayout_getVerticalSpacing},
         {"release", lua_FlowLayout_release},
+        {"setSpacing", lua_FlowLayout_setSpacing},
         {NULL, NULL}
     };
     const luaL_Reg* lua_statics = NULL;
@@ -106,6 +109,41 @@ int lua_FlowLayout_addRef(lua_State* state)
     return 0;
 }
 
+int lua_FlowLayout_getHorizontalSpacing(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                FlowLayout* instance = getInstance(state);
+                int result = instance->getHorizontalSpacing();
+
+                // Push the return value onto the stack.
+                lua_pushinteger(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_FlowLayout_getHorizontalSpacing - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_FlowLayout_getRefCount(lua_State* state)
 {
     // Get the number of parameters.
@@ -176,6 +214,41 @@ int lua_FlowLayout_getType(lua_State* state)
     return 0;
 }
 
+int lua_FlowLayout_getVerticalSpacing(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                FlowLayout* instance = getInstance(state);
+                int result = instance->getVerticalSpacing();
+
+                // Push the return value onto the stack.
+                lua_pushinteger(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_FlowLayout_getVerticalSpacing - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_FlowLayout_release(lua_State* state)
 {
     // Get the number of parameters.
@@ -208,4 +281,44 @@ int lua_FlowLayout_release(lua_State* state)
     return 0;
 }
 
+int lua_FlowLayout_setSpacing(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                int param1 = (int)luaL_checkint(state, 2);
+
+                // Get parameter 2 off the stack.
+                int param2 = (int)luaL_checkint(state, 3);
+
+                FlowLayout* instance = getInstance(state);
+                instance->setSpacing(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_FlowLayout_setSpacing - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 3).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 }

+ 3 - 0
gameplay/src/lua/lua_FlowLayout.h

@@ -7,9 +7,12 @@ namespace gameplay
 // Lua bindings for FlowLayout.
 int lua_FlowLayout__gc(lua_State* state);
 int lua_FlowLayout_addRef(lua_State* state);
+int lua_FlowLayout_getHorizontalSpacing(lua_State* state);
 int lua_FlowLayout_getRefCount(lua_State* state);
 int lua_FlowLayout_getType(lua_State* state);
+int lua_FlowLayout_getVerticalSpacing(lua_State* state);
 int lua_FlowLayout_release(lua_State* state);
+int lua_FlowLayout_setSpacing(lua_State* state);
 
 void luaRegister_FlowLayout();
 

+ 37 - 0
gameplay/src/lua/lua_Font.cpp

@@ -7,6 +7,7 @@
 #include "Font.h"
 #include "Game.h"
 #include "Ref.h"
+#include "lua_FontFormat.h"
 #include "lua_FontJustify.h"
 
 namespace gameplay
@@ -21,6 +22,7 @@ void luaRegister_Font()
         {"drawText", lua_Font_drawText},
         {"finish", lua_Font_finish},
         {"getCharacterSpacing", lua_Font_getCharacterSpacing},
+        {"getFormat", lua_Font_getFormat},
         {"getIndexAtLocation", lua_Font_getIndexAtLocation},
         {"getLocationAtIndex", lua_Font_getLocationAtIndex},
         {"getRefCount", lua_Font_getRefCount},
@@ -1123,6 +1125,41 @@ int lua_Font_getCharacterSpacing(lua_State* state)
     return 0;
 }
 
+int lua_Font_getFormat(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Font* instance = getInstance(state);
+                Font::Format result = instance->getFormat();
+
+                // Push the return value onto the stack.
+                lua_pushstring(state, lua_stringFromEnum_FontFormat(result));
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Font_getFormat - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Font_getIndexAtLocation(lua_State* state)
 {
     // Get the number of parameters.

+ 1 - 0
gameplay/src/lua/lua_Font.h

@@ -11,6 +11,7 @@ int lua_Font_createText(lua_State* state);
 int lua_Font_drawText(lua_State* state);
 int lua_Font_finish(lua_State* state);
 int lua_Font_getCharacterSpacing(lua_State* state);
+int lua_Font_getFormat(lua_State* state);
 int lua_Font_getIndexAtLocation(lua_State* state);
 int lua_Font_getLocationAtIndex(lua_State* state);
 int lua_Font_getRefCount(lua_State* state);

+ 31 - 0
gameplay/src/lua/lua_FontFormat.cpp

@@ -0,0 +1,31 @@
+#include "Base.h"
+#include "lua_FontFormat.h"
+
+namespace gameplay
+{
+
+static const char* enumStringEmpty = "";
+
+static const char* luaEnumString_FontFormat_BITMAP = "BITMAP";
+static const char* luaEnumString_FontFormat_DISTANCE_FIELD = "DISTANCE_FIELD";
+
+Font::Format lua_enumFromString_FontFormat(const char* s)
+{
+    if (strcmp(s, luaEnumString_FontFormat_BITMAP) == 0)
+        return Font::BITMAP;
+    if (strcmp(s, luaEnumString_FontFormat_DISTANCE_FIELD) == 0)
+        return Font::DISTANCE_FIELD;
+    return Font::BITMAP;
+}
+
+const char* lua_stringFromEnum_FontFormat(Font::Format e)
+{
+    if (e == Font::BITMAP)
+        return luaEnumString_FontFormat_BITMAP;
+    if (e == Font::DISTANCE_FIELD)
+        return luaEnumString_FontFormat_DISTANCE_FIELD;
+    return enumStringEmpty;
+}
+
+}
+

+ 15 - 0
gameplay/src/lua/lua_FontFormat.h

@@ -0,0 +1,15 @@
+#ifndef LUA_FONTFORMAT_H_
+#define LUA_FONTFORMAT_H_
+
+#include "Font.h"
+
+namespace gameplay
+{
+
+// Lua bindings for enum conversion functions for Font::Format.
+Font::Format lua_enumFromString_FontFormat(const char* s);
+const char* lua_stringFromEnum_FontFormat(Font::Format e);
+
+}
+
+#endif

+ 1 - 0
gameplay/src/lua/lua_FontText.cpp

@@ -7,6 +7,7 @@
 #include "Font.h"
 #include "Game.h"
 #include "Ref.h"
+#include "lua_FontFormat.h"
 #include "lua_FontJustify.h"
 
 namespace gameplay

+ 369 - 26
gameplay/src/lua/lua_Form.cpp

@@ -28,6 +28,7 @@
 #include "VerticalLayout.h"
 #include "lua_ContainerScroll.h"
 #include "lua_ControlAlignment.h"
+#include "lua_ControlAutoSize.h"
 #include "lua_ControlListenerEventType.h"
 #include "lua_ControlState.h"
 #include "lua_CurveInterpolationType.h"
@@ -100,9 +101,13 @@ void luaRegister_Form()
         {"insertControl", lua_Form_insertControl},
         {"isContainer", lua_Form_isContainer},
         {"isEnabled", lua_Form_isEnabled},
+        {"isHeightPercentage", lua_Form_isHeightPercentage},
         {"isScrollBarsAutoHide", lua_Form_isScrollBarsAutoHide},
         {"isScrolling", lua_Form_isScrolling},
         {"isVisible", lua_Form_isVisible},
+        {"isWidthPercentage", lua_Form_isWidthPercentage},
+        {"isXPercentage", lua_Form_isXPercentage},
+        {"isYPercentage", lua_Form_isYPercentage},
         {"release", lua_Form_release},
         {"removeControl", lua_Form_removeControl},
         {"removeListener", lua_Form_removeListener},
@@ -144,6 +149,8 @@ void luaRegister_Form()
         {"setTextRightToLeft", lua_Form_setTextRightToLeft},
         {"setVisible", lua_Form_setVisible},
         {"setWidth", lua_Form_setWidth},
+        {"setX", lua_Form_setX},
+        {"setY", lua_Form_setY},
         {"setZIndex", lua_Form_setZIndex},
         {"update", lua_Form_update},
         {NULL, NULL}
@@ -1047,10 +1054,10 @@ int lua_Form_getAutoHeight(lua_State* state)
             if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
                 Form* instance = getInstance(state);
-                bool result = instance->getAutoHeight();
+                Control::AutoSize result = instance->getAutoHeight();
 
                 // Push the return value onto the stack.
-                lua_pushboolean(state, result);
+                lua_pushstring(state, lua_stringFromEnum_ControlAutoSize(result));
 
                 return 1;
             }
@@ -1082,10 +1089,10 @@ int lua_Form_getAutoWidth(lua_State* state)
             if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
                 Form* instance = getInstance(state);
-                bool result = instance->getAutoWidth();
+                Control::AutoSize result = instance->getAutoWidth();
 
                 // Push the return value onto the stack.
-                lua_pushboolean(state, result);
+                lua_pushstring(state, lua_stringFromEnum_ControlAutoSize(result));
 
                 return 1;
             }
@@ -2232,7 +2239,7 @@ int lua_Form_getScrollPosition(lua_State* state)
                 void* returnPtr = (void*)&(instance->getScrollPosition());
                 if (returnPtr)
                 {
-                    ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
+                    gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
                     object->instance = returnPtr;
                     object->owns = false;
                     luaL_getmetatable(state, "Vector2");
@@ -3113,6 +3120,41 @@ int lua_Form_isEnabled(lua_State* state)
     return 0;
 }
 
+int lua_Form_isHeightPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Form* instance = getInstance(state);
+                bool result = instance->isHeightPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Form_isHeightPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Form_isScrollBarsAutoHide(lua_State* state)
 {
     // Get the number of parameters.
@@ -3218,6 +3260,111 @@ int lua_Form_isVisible(lua_State* state)
     return 0;
 }
 
+int lua_Form_isWidthPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Form* instance = getInstance(state);
+                bool result = instance->isWidthPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Form_isWidthPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Form_isXPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Form* instance = getInstance(state);
+                bool result = instance->isXPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Form_isXPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Form_isYPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Form* instance = getInstance(state);
+                bool result = instance->isYPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Form_isYPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Form_release(lua_State* state)
 {
     // Get the number of parameters.
@@ -3528,17 +3675,35 @@ int lua_Form_setAutoHeight(lua_State* state)
     {
         case 2:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                lua_type(state, 2) == LUA_TBOOLEAN)
+            do
             {
-                // Get parameter 1 off the stack.
-                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    lua_type(state, 2) == LUA_TBOOLEAN)
+                {
+                    // Get parameter 1 off the stack.
+                    bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
 
-                Form* instance = getInstance(state);
-                instance->setAutoHeight(param1);
-                
-                return 0;
-            }
+                    Form* instance = getInstance(state);
+                    instance->setAutoHeight(param1);
+                    
+                    return 0;
+                }
+            } while (0);
+
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
+                {
+                    // Get parameter 1 off the stack.
+                    Control::AutoSize param1 = (Control::AutoSize)lua_enumFromString_ControlAutoSize(luaL_checkstring(state, 2));
+
+                    Form* instance = getInstance(state);
+                    instance->setAutoHeight(param1);
+                    
+                    return 0;
+                }
+            } while (0);
 
             lua_pushstring(state, "lua_Form_setAutoHeight - Failed to match the given parameters to a valid function signature.");
             lua_error(state);
@@ -3564,17 +3729,35 @@ int lua_Form_setAutoWidth(lua_State* state)
     {
         case 2:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                lua_type(state, 2) == LUA_TBOOLEAN)
+            do
             {
-                // Get parameter 1 off the stack.
-                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    lua_type(state, 2) == LUA_TBOOLEAN)
+                {
+                    // Get parameter 1 off the stack.
+                    bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
 
-                Form* instance = getInstance(state);
-                instance->setAutoWidth(param1);
-                
-                return 0;
-            }
+                    Form* instance = getInstance(state);
+                    instance->setAutoWidth(param1);
+                    
+                    return 0;
+                }
+            } while (0);
+
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
+                {
+                    // Get parameter 1 off the stack.
+                    Control::AutoSize param1 = (Control::AutoSize)lua_enumFromString_ControlAutoSize(luaL_checkstring(state, 2));
+
+                    Form* instance = getInstance(state);
+                    instance->setAutoWidth(param1);
+                    
+                    return 0;
+                }
+            } while (0);
 
             lua_pushstring(state, "lua_Form_setAutoWidth - Failed to match the given parameters to a valid function signature.");
             lua_error(state);
@@ -4068,9 +4251,31 @@ int lua_Form_setHeight(lua_State* state)
             lua_error(state);
             break;
         }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                Form* instance = getInstance(state);
+                instance->setHeight(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Form_setHeight - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
             lua_error(state);
             break;
         }
@@ -4557,7 +4762,7 @@ int lua_Form_setScrollPosition(lua_State* state)
             {
                 // Get parameter 1 off the stack.
                 bool param1Valid;
-                ScriptUtil::LuaArray<Vector2> param1 = ScriptUtil::getObjectPointer<Vector2>(2, "Vector2", true, &param1Valid);
+                gameplay::ScriptUtil::LuaArray<Vector2> param1 = gameplay::ScriptUtil::getObjectPointer<Vector2>(2, "Vector2", true, &param1Valid);
                 if (!param1Valid)
                 {
                     lua_pushstring(state, "Failed to convert parameter 1 to type 'Vector2'.");
@@ -5198,9 +5403,147 @@ int lua_Form_setWidth(lua_State* state)
             lua_error(state);
             break;
         }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                Form* instance = getInstance(state);
+                instance->setWidth(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Form_setWidth - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Form_setX(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                Form* instance = getInstance(state);
+                instance->setX(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Form_setX - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                Form* instance = getInstance(state);
+                instance->setX(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Form_setX - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Form_setY(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                Form* instance = getInstance(state);
+                instance->setY(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Form_setY - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                Form* instance = getInstance(state);
+                instance->setY(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Form_setY - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
             lua_error(state);
             break;
         }

+ 6 - 0
gameplay/src/lua/lua_Form.h

@@ -65,9 +65,13 @@ int lua_Form_getZIndex(lua_State* state);
 int lua_Form_insertControl(lua_State* state);
 int lua_Form_isContainer(lua_State* state);
 int lua_Form_isEnabled(lua_State* state);
+int lua_Form_isHeightPercentage(lua_State* state);
 int lua_Form_isScrollBarsAutoHide(lua_State* state);
 int lua_Form_isScrolling(lua_State* state);
 int lua_Form_isVisible(lua_State* state);
+int lua_Form_isWidthPercentage(lua_State* state);
+int lua_Form_isXPercentage(lua_State* state);
+int lua_Form_isYPercentage(lua_State* state);
 int lua_Form_release(lua_State* state);
 int lua_Form_removeControl(lua_State* state);
 int lua_Form_removeListener(lua_State* state);
@@ -109,6 +113,8 @@ int lua_Form_setTextColor(lua_State* state);
 int lua_Form_setTextRightToLeft(lua_State* state);
 int lua_Form_setVisible(lua_State* state);
 int lua_Form_setWidth(lua_State* state);
+int lua_Form_setX(lua_State* state);
+int lua_Form_setY(lua_State* state);
 int lua_Form_setZIndex(lua_State* state);
 int lua_Form_static_ANIMATE_OPACITY(lua_State* state);
 int lua_Form_static_ANIMATE_POSITION(lua_State* state);

+ 44 - 44
gameplay/src/lua/lua_Game.cpp

@@ -1069,6 +1069,50 @@ int lua_Game_getPhysicsController(lua_State* state)
     return 0;
 }
 
+int lua_Game_getScriptController(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Game* instance = getInstance(state);
+                void* returnPtr = (void*)instance->getScriptController();
+                if (returnPtr)
+                {
+                    gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
+                    object->instance = returnPtr;
+                    object->owns = false;
+                    luaL_getmetatable(state, "ScriptController");
+                    lua_setmetatable(state, -2);
+                }
+                else
+                {
+                    lua_pushnil(state);
+                }
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Game_getScriptController - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Game_getSensorValues(lua_State* state)
 {
     // Get the number of parameters.
@@ -1125,50 +1169,6 @@ int lua_Game_getSensorValues(lua_State* state)
     return 0;
 }
 
-int lua_Game_getScriptController(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 1:
-        {
-            if ((lua_type(state, 1) == LUA_TUSERDATA))
-            {
-                Game* instance = getInstance(state);
-                void* returnPtr = (void*)instance->getScriptController();
-                if (returnPtr)
-                {
-                    gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
-                    object->instance = returnPtr;
-                    object->owns = false;
-                    luaL_getmetatable(state, "ScriptController");
-                    lua_setmetatable(state, -2);
-                }
-                else
-                {
-                    lua_pushnil(state);
-                }
-
-                return 1;
-            }
-
-            lua_pushstring(state, "lua_Game_getScriptController - Failed to match the given parameters to a valid function signature.");
-            lua_error(state);
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 1).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
 int lua_Game_getState(lua_State* state)
 {
     // Get the number of parameters.

+ 31 - 0
gameplay/src/lua/lua_Global.cpp

@@ -213,6 +213,15 @@ void luaRegister_lua_Global()
         gameplay::ScriptUtil::registerConstantString("ALIGN_BOTTOM_RIGHT", "ALIGN_BOTTOM_RIGHT", scopePath);
     }
 
+    // Register enumeration Control::AutoSize.
+    {
+        std::vector<std::string> scopePath;
+        scopePath.push_back("Control");
+        gameplay::ScriptUtil::registerConstantString("AUTO_SIZE_NONE", "AUTO_SIZE_NONE", scopePath);
+        gameplay::ScriptUtil::registerConstantString("AUTO_SIZE_STRETCH", "AUTO_SIZE_STRETCH", scopePath);
+        gameplay::ScriptUtil::registerConstantString("AUTO_SIZE_FIT", "AUTO_SIZE_FIT", scopePath);
+    }
+
     // Register enumeration Control::Listener::EventType.
     {
         std::vector<std::string> scopePath;
@@ -301,6 +310,14 @@ void luaRegister_lua_Global()
         gameplay::ScriptUtil::registerConstantString("DEPTH_STENCIL", "DEPTH_STENCIL", scopePath);
     }
 
+    // Register enumeration Font::Format.
+    {
+        std::vector<std::string> scopePath;
+        scopePath.push_back("Font");
+        gameplay::ScriptUtil::registerConstantString("BITMAP", "BITMAP", scopePath);
+        gameplay::ScriptUtil::registerConstantString("DISTANCE_FIELD", "DISTANCE_FIELD", scopePath);
+    }
+
     // Register enumeration Font::Justify.
     {
         std::vector<std::string> scopePath;
@@ -777,6 +794,14 @@ void luaRegister_lua_Global()
         gameplay::ScriptUtil::registerConstantString("DEPTH_ALWAYS", "DEPTH_ALWAYS", scopePath);
     }
 
+    // Register enumeration RenderState::FrontFace.
+    {
+        std::vector<std::string> scopePath;
+        scopePath.push_back("RenderState");
+        gameplay::ScriptUtil::registerConstantString("FRONT_FACE_CW", "FRONT_FACE_CW", scopePath);
+        gameplay::ScriptUtil::registerConstantString("FRONT_FACE_CCW", "FRONT_FACE_CCW", scopePath);
+    }
+
     // Register enumeration RenderState::StencilFunction.
     {
         std::vector<std::string> scopePath;
@@ -907,6 +932,8 @@ const char* lua_stringFromEnumGlobal(std::string& enumname, unsigned int value)
         return lua_stringFromEnum_ContainerScroll((Container::Scroll)value);
     if (enumname == "Control::Alignment")
         return lua_stringFromEnum_ControlAlignment((Control::Alignment)value);
+    if (enumname == "Control::AutoSize")
+        return lua_stringFromEnum_ControlAutoSize((Control::AutoSize)value);
     if (enumname == "Control::Listener::EventType")
         return lua_stringFromEnum_ControlListenerEventType((Control::Listener::EventType)value);
     if (enumname == "Control::State")
@@ -915,6 +942,8 @@ const char* lua_stringFromEnumGlobal(std::string& enumname, unsigned int value)
         return lua_stringFromEnum_CurveInterpolationType((Curve::InterpolationType)value);
     if (enumname == "DepthStencilTarget::Format")
         return lua_stringFromEnum_DepthStencilTargetFormat((DepthStencilTarget::Format)value);
+    if (enumname == "Font::Format")
+        return lua_stringFromEnum_FontFormat((Font::Format)value);
     if (enumname == "Font::Justify")
         return lua_stringFromEnum_FontJustify((Font::Justify)value);
     if (enumname == "Font::Style")
@@ -969,6 +998,8 @@ const char* lua_stringFromEnumGlobal(std::string& enumname, unsigned int value)
         return lua_stringFromEnum_RenderStateCullFaceSide((RenderState::CullFaceSide)value);
     if (enumname == "RenderState::DepthFunction")
         return lua_stringFromEnum_RenderStateDepthFunction((RenderState::DepthFunction)value);
+    if (enumname == "RenderState::FrontFace")
+        return lua_stringFromEnum_RenderStateFrontFace((RenderState::FrontFace)value);
     if (enumname == "RenderState::StencilFunction")
         return lua_stringFromEnum_RenderStateStencilFunction((RenderState::StencilFunction)value);
     if (enumname == "RenderState::StencilOperation")

+ 3 - 0
gameplay/src/lua/lua_Global.h

@@ -7,10 +7,12 @@
 #include "lua_CameraType.h"
 #include "lua_ContainerScroll.h"
 #include "lua_ControlAlignment.h"
+#include "lua_ControlAutoSize.h"
 #include "lua_ControlListenerEventType.h"
 #include "lua_ControlState.h"
 #include "lua_CurveInterpolationType.h"
 #include "lua_DepthStencilTargetFormat.h"
+#include "lua_FontFormat.h"
 #include "lua_FontJustify.h"
 #include "lua_FontStyle.h"
 #include "lua_GameClearFlags.h"
@@ -38,6 +40,7 @@
 #include "lua_RenderStateBlend.h"
 #include "lua_RenderStateCullFaceSide.h"
 #include "lua_RenderStateDepthFunction.h"
+#include "lua_RenderStateFrontFace.h"
 #include "lua_RenderStateStencilFunction.h"
 #include "lua_RenderStateStencilOperation.h"
 #include "lua_SceneDebugFlags.h"

+ 367 - 24
gameplay/src/lua/lua_ImageControl.cpp

@@ -15,6 +15,7 @@
 #include "ScriptController.h"
 #include "ScriptTarget.h"
 #include "lua_ControlAlignment.h"
+#include "lua_ControlAutoSize.h"
 #include "lua_ControlListenerEventType.h"
 #include "lua_ControlState.h"
 #include "lua_CurveInterpolationType.h"
@@ -78,7 +79,11 @@ void luaRegister_ImageControl()
         {"getZIndex", lua_ImageControl_getZIndex},
         {"isContainer", lua_ImageControl_isContainer},
         {"isEnabled", lua_ImageControl_isEnabled},
+        {"isHeightPercentage", lua_ImageControl_isHeightPercentage},
         {"isVisible", lua_ImageControl_isVisible},
+        {"isWidthPercentage", lua_ImageControl_isWidthPercentage},
+        {"isXPercentage", lua_ImageControl_isXPercentage},
+        {"isYPercentage", lua_ImageControl_isYPercentage},
         {"release", lua_ImageControl_release},
         {"removeListener", lua_ImageControl_removeListener},
         {"removeScriptCallback", lua_ImageControl_removeScriptCallback},
@@ -116,6 +121,8 @@ void luaRegister_ImageControl()
         {"setTextRightToLeft", lua_ImageControl_setTextRightToLeft},
         {"setVisible", lua_ImageControl_setVisible},
         {"setWidth", lua_ImageControl_setWidth},
+        {"setX", lua_ImageControl_setX},
+        {"setY", lua_ImageControl_setY},
         {"setZIndex", lua_ImageControl_setZIndex},
         {NULL, NULL}
     };
@@ -939,10 +946,10 @@ int lua_ImageControl_getAutoHeight(lua_State* state)
             if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
                 ImageControl* instance = getInstance(state);
-                bool result = instance->getAutoHeight();
+                Control::AutoSize result = instance->getAutoHeight();
 
                 // Push the return value onto the stack.
-                lua_pushboolean(state, result);
+                lua_pushstring(state, lua_stringFromEnum_ControlAutoSize(result));
 
                 return 1;
             }
@@ -974,10 +981,10 @@ int lua_ImageControl_getAutoWidth(lua_State* state)
             if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
                 ImageControl* instance = getInstance(state);
-                bool result = instance->getAutoWidth();
+                Control::AutoSize result = instance->getAutoWidth();
 
                 // Push the return value onto the stack.
-                lua_pushboolean(state, result);
+                lua_pushstring(state, lua_stringFromEnum_ControlAutoSize(result));
 
                 return 1;
             }
@@ -2732,6 +2739,41 @@ int lua_ImageControl_isEnabled(lua_State* state)
     return 0;
 }
 
+int lua_ImageControl_isHeightPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                ImageControl* instance = getInstance(state);
+                bool result = instance->isHeightPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_ImageControl_isHeightPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_ImageControl_isVisible(lua_State* state)
 {
     // Get the number of parameters.
@@ -2767,6 +2809,111 @@ int lua_ImageControl_isVisible(lua_State* state)
     return 0;
 }
 
+int lua_ImageControl_isWidthPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                ImageControl* instance = getInstance(state);
+                bool result = instance->isWidthPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_ImageControl_isWidthPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_ImageControl_isXPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                ImageControl* instance = getInstance(state);
+                bool result = instance->isXPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_ImageControl_isXPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_ImageControl_isYPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                ImageControl* instance = getInstance(state);
+                bool result = instance->isYPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_ImageControl_isYPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_ImageControl_release(lua_State* state)
 {
     // Get the number of parameters.
@@ -3005,17 +3152,35 @@ int lua_ImageControl_setAutoHeight(lua_State* state)
     {
         case 2:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                lua_type(state, 2) == LUA_TBOOLEAN)
+            do
             {
-                // Get parameter 1 off the stack.
-                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    lua_type(state, 2) == LUA_TBOOLEAN)
+                {
+                    // Get parameter 1 off the stack.
+                    bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
 
-                ImageControl* instance = getInstance(state);
-                instance->setAutoHeight(param1);
-                
-                return 0;
-            }
+                    ImageControl* instance = getInstance(state);
+                    instance->setAutoHeight(param1);
+                    
+                    return 0;
+                }
+            } while (0);
+
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
+                {
+                    // Get parameter 1 off the stack.
+                    Control::AutoSize param1 = (Control::AutoSize)lua_enumFromString_ControlAutoSize(luaL_checkstring(state, 2));
+
+                    ImageControl* instance = getInstance(state);
+                    instance->setAutoHeight(param1);
+                    
+                    return 0;
+                }
+            } while (0);
 
             lua_pushstring(state, "lua_ImageControl_setAutoHeight - Failed to match the given parameters to a valid function signature.");
             lua_error(state);
@@ -3041,17 +3206,35 @@ int lua_ImageControl_setAutoWidth(lua_State* state)
     {
         case 2:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                lua_type(state, 2) == LUA_TBOOLEAN)
+            do
             {
-                // Get parameter 1 off the stack.
-                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    lua_type(state, 2) == LUA_TBOOLEAN)
+                {
+                    // Get parameter 1 off the stack.
+                    bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
 
-                ImageControl* instance = getInstance(state);
-                instance->setAutoWidth(param1);
-                
-                return 0;
-            }
+                    ImageControl* instance = getInstance(state);
+                    instance->setAutoWidth(param1);
+                    
+                    return 0;
+                }
+            } while (0);
+
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
+                {
+                    // Get parameter 1 off the stack.
+                    Control::AutoSize param1 = (Control::AutoSize)lua_enumFromString_ControlAutoSize(luaL_checkstring(state, 2));
+
+                    ImageControl* instance = getInstance(state);
+                    instance->setAutoWidth(param1);
+                    
+                    return 0;
+                }
+            } while (0);
 
             lua_pushstring(state, "lua_ImageControl_setAutoWidth - Failed to match the given parameters to a valid function signature.");
             lua_error(state);
@@ -3545,9 +3728,31 @@ int lua_ImageControl_setHeight(lua_State* state)
             lua_error(state);
             break;
         }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                ImageControl* instance = getInstance(state);
+                instance->setHeight(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_ImageControl_setHeight - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
             lua_error(state);
             break;
         }
@@ -4633,9 +4838,147 @@ int lua_ImageControl_setWidth(lua_State* state)
             lua_error(state);
             break;
         }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                ImageControl* instance = getInstance(state);
+                instance->setWidth(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_ImageControl_setWidth - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_ImageControl_setX(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                ImageControl* instance = getInstance(state);
+                instance->setX(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_ImageControl_setX - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                ImageControl* instance = getInstance(state);
+                instance->setX(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_ImageControl_setX - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_ImageControl_setY(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                ImageControl* instance = getInstance(state);
+                instance->setY(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_ImageControl_setY - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                ImageControl* instance = getInstance(state);
+                instance->setY(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_ImageControl_setY - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
             lua_error(state);
             break;
         }

+ 6 - 0
gameplay/src/lua/lua_ImageControl.h

@@ -57,7 +57,11 @@ int lua_ImageControl_getY(lua_State* state);
 int lua_ImageControl_getZIndex(lua_State* state);
 int lua_ImageControl_isContainer(lua_State* state);
 int lua_ImageControl_isEnabled(lua_State* state);
+int lua_ImageControl_isHeightPercentage(lua_State* state);
 int lua_ImageControl_isVisible(lua_State* state);
+int lua_ImageControl_isWidthPercentage(lua_State* state);
+int lua_ImageControl_isXPercentage(lua_State* state);
+int lua_ImageControl_isYPercentage(lua_State* state);
 int lua_ImageControl_release(lua_State* state);
 int lua_ImageControl_removeListener(lua_State* state);
 int lua_ImageControl_removeScriptCallback(lua_State* state);
@@ -95,6 +99,8 @@ int lua_ImageControl_setTextColor(lua_State* state);
 int lua_ImageControl_setTextRightToLeft(lua_State* state);
 int lua_ImageControl_setVisible(lua_State* state);
 int lua_ImageControl_setWidth(lua_State* state);
+int lua_ImageControl_setX(lua_State* state);
+int lua_ImageControl_setY(lua_State* state);
 int lua_ImageControl_setZIndex(lua_State* state);
 int lua_ImageControl_static_ANIMATE_OPACITY(lua_State* state);
 int lua_ImageControl_static_ANIMATE_POSITION(lua_State* state);

+ 367 - 24
gameplay/src/lua/lua_Joystick.cpp

@@ -12,6 +12,7 @@
 #include "ScriptController.h"
 #include "ScriptTarget.h"
 #include "lua_ControlAlignment.h"
+#include "lua_ControlAutoSize.h"
 #include "lua_ControlListenerEventType.h"
 #include "lua_ControlState.h"
 #include "lua_CurveInterpolationType.h"
@@ -76,8 +77,12 @@ void luaRegister_Joystick()
         {"getZIndex", lua_Joystick_getZIndex},
         {"isContainer", lua_Joystick_isContainer},
         {"isEnabled", lua_Joystick_isEnabled},
+        {"isHeightPercentage", lua_Joystick_isHeightPercentage},
         {"isRelative", lua_Joystick_isRelative},
         {"isVisible", lua_Joystick_isVisible},
+        {"isWidthPercentage", lua_Joystick_isWidthPercentage},
+        {"isXPercentage", lua_Joystick_isXPercentage},
+        {"isYPercentage", lua_Joystick_isYPercentage},
         {"release", lua_Joystick_release},
         {"removeListener", lua_Joystick_removeListener},
         {"removeScriptCallback", lua_Joystick_removeScriptCallback},
@@ -114,6 +119,8 @@ void luaRegister_Joystick()
         {"setTextRightToLeft", lua_Joystick_setTextRightToLeft},
         {"setVisible", lua_Joystick_setVisible},
         {"setWidth", lua_Joystick_setWidth},
+        {"setX", lua_Joystick_setX},
+        {"setY", lua_Joystick_setY},
         {"setZIndex", lua_Joystick_setZIndex},
         {NULL, NULL}
     };
@@ -937,10 +944,10 @@ int lua_Joystick_getAutoHeight(lua_State* state)
             if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
                 Joystick* instance = getInstance(state);
-                bool result = instance->getAutoHeight();
+                Control::AutoSize result = instance->getAutoHeight();
 
                 // Push the return value onto the stack.
-                lua_pushboolean(state, result);
+                lua_pushstring(state, lua_stringFromEnum_ControlAutoSize(result));
 
                 return 1;
             }
@@ -972,10 +979,10 @@ int lua_Joystick_getAutoWidth(lua_State* state)
             if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
                 Joystick* instance = getInstance(state);
-                bool result = instance->getAutoWidth();
+                Control::AutoSize result = instance->getAutoWidth();
 
                 // Push the return value onto the stack.
-                lua_pushboolean(state, result);
+                lua_pushstring(state, lua_stringFromEnum_ControlAutoSize(result));
 
                 return 1;
             }
@@ -2774,6 +2781,41 @@ int lua_Joystick_isEnabled(lua_State* state)
     return 0;
 }
 
+int lua_Joystick_isHeightPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Joystick* instance = getInstance(state);
+                bool result = instance->isHeightPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Joystick_isHeightPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Joystick_isRelative(lua_State* state)
 {
     // Get the number of parameters.
@@ -2844,6 +2886,111 @@ int lua_Joystick_isVisible(lua_State* state)
     return 0;
 }
 
+int lua_Joystick_isWidthPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Joystick* instance = getInstance(state);
+                bool result = instance->isWidthPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Joystick_isWidthPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Joystick_isXPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Joystick* instance = getInstance(state);
+                bool result = instance->isXPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Joystick_isXPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Joystick_isYPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Joystick* instance = getInstance(state);
+                bool result = instance->isYPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Joystick_isYPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Joystick_release(lua_State* state)
 {
     // Get the number of parameters.
@@ -3082,17 +3229,35 @@ int lua_Joystick_setAutoHeight(lua_State* state)
     {
         case 2:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                lua_type(state, 2) == LUA_TBOOLEAN)
+            do
             {
-                // Get parameter 1 off the stack.
-                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    lua_type(state, 2) == LUA_TBOOLEAN)
+                {
+                    // Get parameter 1 off the stack.
+                    bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
 
-                Joystick* instance = getInstance(state);
-                instance->setAutoHeight(param1);
-                
-                return 0;
-            }
+                    Joystick* instance = getInstance(state);
+                    instance->setAutoHeight(param1);
+                    
+                    return 0;
+                }
+            } while (0);
+
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
+                {
+                    // Get parameter 1 off the stack.
+                    Control::AutoSize param1 = (Control::AutoSize)lua_enumFromString_ControlAutoSize(luaL_checkstring(state, 2));
+
+                    Joystick* instance = getInstance(state);
+                    instance->setAutoHeight(param1);
+                    
+                    return 0;
+                }
+            } while (0);
 
             lua_pushstring(state, "lua_Joystick_setAutoHeight - Failed to match the given parameters to a valid function signature.");
             lua_error(state);
@@ -3118,17 +3283,35 @@ int lua_Joystick_setAutoWidth(lua_State* state)
     {
         case 2:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                lua_type(state, 2) == LUA_TBOOLEAN)
+            do
             {
-                // Get parameter 1 off the stack.
-                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    lua_type(state, 2) == LUA_TBOOLEAN)
+                {
+                    // Get parameter 1 off the stack.
+                    bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
 
-                Joystick* instance = getInstance(state);
-                instance->setAutoWidth(param1);
-                
-                return 0;
-            }
+                    Joystick* instance = getInstance(state);
+                    instance->setAutoWidth(param1);
+                    
+                    return 0;
+                }
+            } while (0);
+
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
+                {
+                    // Get parameter 1 off the stack.
+                    Control::AutoSize param1 = (Control::AutoSize)lua_enumFromString_ControlAutoSize(luaL_checkstring(state, 2));
+
+                    Joystick* instance = getInstance(state);
+                    instance->setAutoWidth(param1);
+                    
+                    return 0;
+                }
+            } while (0);
 
             lua_pushstring(state, "lua_Joystick_setAutoWidth - Failed to match the given parameters to a valid function signature.");
             lua_error(state);
@@ -3622,9 +3805,31 @@ int lua_Joystick_setHeight(lua_State* state)
             lua_error(state);
             break;
         }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                Joystick* instance = getInstance(state);
+                instance->setHeight(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Joystick_setHeight - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
             lua_error(state);
             break;
         }
@@ -4608,9 +4813,147 @@ int lua_Joystick_setWidth(lua_State* state)
             lua_error(state);
             break;
         }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                Joystick* instance = getInstance(state);
+                instance->setWidth(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Joystick_setWidth - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Joystick_setX(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                Joystick* instance = getInstance(state);
+                instance->setX(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Joystick_setX - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                Joystick* instance = getInstance(state);
+                instance->setX(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Joystick_setX - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Joystick_setY(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                Joystick* instance = getInstance(state);
+                instance->setY(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Joystick_setY - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                Joystick* instance = getInstance(state);
+                instance->setY(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Joystick_setY - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
             lua_error(state);
             break;
         }

+ 6 - 0
gameplay/src/lua/lua_Joystick.h

@@ -58,8 +58,12 @@ int lua_Joystick_getY(lua_State* state);
 int lua_Joystick_getZIndex(lua_State* state);
 int lua_Joystick_isContainer(lua_State* state);
 int lua_Joystick_isEnabled(lua_State* state);
+int lua_Joystick_isHeightPercentage(lua_State* state);
 int lua_Joystick_isRelative(lua_State* state);
 int lua_Joystick_isVisible(lua_State* state);
+int lua_Joystick_isWidthPercentage(lua_State* state);
+int lua_Joystick_isXPercentage(lua_State* state);
+int lua_Joystick_isYPercentage(lua_State* state);
 int lua_Joystick_release(lua_State* state);
 int lua_Joystick_removeListener(lua_State* state);
 int lua_Joystick_removeScriptCallback(lua_State* state);
@@ -96,6 +100,8 @@ int lua_Joystick_setTextColor(lua_State* state);
 int lua_Joystick_setTextRightToLeft(lua_State* state);
 int lua_Joystick_setVisible(lua_State* state);
 int lua_Joystick_setWidth(lua_State* state);
+int lua_Joystick_setX(lua_State* state);
+int lua_Joystick_setY(lua_State* state);
 int lua_Joystick_setZIndex(lua_State* state);
 int lua_Joystick_static_ANIMATE_OPACITY(lua_State* state);
 int lua_Joystick_static_ANIMATE_POSITION(lua_State* state);

+ 367 - 24
gameplay/src/lua/lua_Label.cpp

@@ -12,6 +12,7 @@
 #include "ScriptController.h"
 #include "ScriptTarget.h"
 #include "lua_ControlAlignment.h"
+#include "lua_ControlAutoSize.h"
 #include "lua_ControlListenerEventType.h"
 #include "lua_ControlState.h"
 #include "lua_CurveInterpolationType.h"
@@ -73,7 +74,11 @@ void luaRegister_Label()
         {"getZIndex", lua_Label_getZIndex},
         {"isContainer", lua_Label_isContainer},
         {"isEnabled", lua_Label_isEnabled},
+        {"isHeightPercentage", lua_Label_isHeightPercentage},
         {"isVisible", lua_Label_isVisible},
+        {"isWidthPercentage", lua_Label_isWidthPercentage},
+        {"isXPercentage", lua_Label_isXPercentage},
+        {"isYPercentage", lua_Label_isYPercentage},
         {"release", lua_Label_release},
         {"removeListener", lua_Label_removeListener},
         {"removeScriptCallback", lua_Label_removeScriptCallback},
@@ -108,6 +113,8 @@ void luaRegister_Label()
         {"setTextRightToLeft", lua_Label_setTextRightToLeft},
         {"setVisible", lua_Label_setVisible},
         {"setWidth", lua_Label_setWidth},
+        {"setX", lua_Label_setX},
+        {"setY", lua_Label_setY},
         {"setZIndex", lua_Label_setZIndex},
         {NULL, NULL}
     };
@@ -931,10 +938,10 @@ int lua_Label_getAutoHeight(lua_State* state)
             if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
                 Label* instance = getInstance(state);
-                bool result = instance->getAutoHeight();
+                Control::AutoSize result = instance->getAutoHeight();
 
                 // Push the return value onto the stack.
-                lua_pushboolean(state, result);
+                lua_pushstring(state, lua_stringFromEnum_ControlAutoSize(result));
 
                 return 1;
             }
@@ -966,10 +973,10 @@ int lua_Label_getAutoWidth(lua_State* state)
             if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
                 Label* instance = getInstance(state);
-                bool result = instance->getAutoWidth();
+                Control::AutoSize result = instance->getAutoWidth();
 
                 // Push the return value onto the stack.
-                lua_pushboolean(state, result);
+                lua_pushstring(state, lua_stringFromEnum_ControlAutoSize(result));
 
                 return 1;
             }
@@ -2636,6 +2643,41 @@ int lua_Label_isEnabled(lua_State* state)
     return 0;
 }
 
+int lua_Label_isHeightPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Label* instance = getInstance(state);
+                bool result = instance->isHeightPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Label_isHeightPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Label_isVisible(lua_State* state)
 {
     // Get the number of parameters.
@@ -2671,6 +2713,111 @@ int lua_Label_isVisible(lua_State* state)
     return 0;
 }
 
+int lua_Label_isWidthPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Label* instance = getInstance(state);
+                bool result = instance->isWidthPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Label_isWidthPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Label_isXPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Label* instance = getInstance(state);
+                bool result = instance->isXPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Label_isXPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Label_isYPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Label* instance = getInstance(state);
+                bool result = instance->isYPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Label_isYPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Label_release(lua_State* state)
 {
     // Get the number of parameters.
@@ -2909,17 +3056,35 @@ int lua_Label_setAutoHeight(lua_State* state)
     {
         case 2:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                lua_type(state, 2) == LUA_TBOOLEAN)
+            do
             {
-                // Get parameter 1 off the stack.
-                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    lua_type(state, 2) == LUA_TBOOLEAN)
+                {
+                    // Get parameter 1 off the stack.
+                    bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
 
-                Label* instance = getInstance(state);
-                instance->setAutoHeight(param1);
-                
-                return 0;
-            }
+                    Label* instance = getInstance(state);
+                    instance->setAutoHeight(param1);
+                    
+                    return 0;
+                }
+            } while (0);
+
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
+                {
+                    // Get parameter 1 off the stack.
+                    Control::AutoSize param1 = (Control::AutoSize)lua_enumFromString_ControlAutoSize(luaL_checkstring(state, 2));
+
+                    Label* instance = getInstance(state);
+                    instance->setAutoHeight(param1);
+                    
+                    return 0;
+                }
+            } while (0);
 
             lua_pushstring(state, "lua_Label_setAutoHeight - Failed to match the given parameters to a valid function signature.");
             lua_error(state);
@@ -2945,17 +3110,35 @@ int lua_Label_setAutoWidth(lua_State* state)
     {
         case 2:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                lua_type(state, 2) == LUA_TBOOLEAN)
+            do
             {
-                // Get parameter 1 off the stack.
-                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    lua_type(state, 2) == LUA_TBOOLEAN)
+                {
+                    // Get parameter 1 off the stack.
+                    bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
 
-                Label* instance = getInstance(state);
-                instance->setAutoWidth(param1);
-                
-                return 0;
-            }
+                    Label* instance = getInstance(state);
+                    instance->setAutoWidth(param1);
+                    
+                    return 0;
+                }
+            } while (0);
+
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
+                {
+                    // Get parameter 1 off the stack.
+                    Control::AutoSize param1 = (Control::AutoSize)lua_enumFromString_ControlAutoSize(luaL_checkstring(state, 2));
+
+                    Label* instance = getInstance(state);
+                    instance->setAutoWidth(param1);
+                    
+                    return 0;
+                }
+            } while (0);
 
             lua_pushstring(state, "lua_Label_setAutoWidth - Failed to match the given parameters to a valid function signature.");
             lua_error(state);
@@ -3449,9 +3632,31 @@ int lua_Label_setHeight(lua_State* state)
             lua_error(state);
             break;
         }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                Label* instance = getInstance(state);
+                instance->setHeight(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Label_setHeight - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
             lua_error(state);
             break;
         }
@@ -4351,9 +4556,147 @@ int lua_Label_setWidth(lua_State* state)
             lua_error(state);
             break;
         }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                Label* instance = getInstance(state);
+                instance->setWidth(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Label_setWidth - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Label_setX(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                Label* instance = getInstance(state);
+                instance->setX(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Label_setX - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                Label* instance = getInstance(state);
+                instance->setX(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Label_setX - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Label_setY(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                Label* instance = getInstance(state);
+                instance->setY(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Label_setY - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                Label* instance = getInstance(state);
+                instance->setY(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Label_setY - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
             lua_error(state);
             break;
         }

+ 6 - 0
gameplay/src/lua/lua_Label.h

@@ -55,7 +55,11 @@ int lua_Label_getY(lua_State* state);
 int lua_Label_getZIndex(lua_State* state);
 int lua_Label_isContainer(lua_State* state);
 int lua_Label_isEnabled(lua_State* state);
+int lua_Label_isHeightPercentage(lua_State* state);
 int lua_Label_isVisible(lua_State* state);
+int lua_Label_isWidthPercentage(lua_State* state);
+int lua_Label_isXPercentage(lua_State* state);
+int lua_Label_isYPercentage(lua_State* state);
 int lua_Label_release(lua_State* state);
 int lua_Label_removeListener(lua_State* state);
 int lua_Label_removeScriptCallback(lua_State* state);
@@ -90,6 +94,8 @@ int lua_Label_setTextColor(lua_State* state);
 int lua_Label_setTextRightToLeft(lua_State* state);
 int lua_Label_setVisible(lua_State* state);
 int lua_Label_setWidth(lua_State* state);
+int lua_Label_setX(lua_State* state);
+int lua_Label_setY(lua_State* state);
 int lua_Label_setZIndex(lua_State* state);
 int lua_Label_static_ANIMATE_OPACITY(lua_State* state);
 int lua_Label_static_ANIMATE_POSITION(lua_State* state);

+ 1 - 0
gameplay/src/lua/lua_Material.cpp

@@ -17,6 +17,7 @@
 #include "lua_RenderStateBlend.h"
 #include "lua_RenderStateCullFaceSide.h"
 #include "lua_RenderStateDepthFunction.h"
+#include "lua_RenderStateFrontFace.h"
 #include "lua_RenderStateStencilFunction.h"
 #include "lua_RenderStateStencilOperation.h"
 

+ 481 - 0
gameplay/src/lua/lua_ParticleEmitter.cpp

@@ -19,6 +19,7 @@ void luaRegister_ParticleEmitter()
     const luaL_Reg lua_members[] = 
     {
         {"addRef", lua_ParticleEmitter_addRef},
+        {"clone", lua_ParticleEmitter_clone},
         {"draw", lua_ParticleEmitter_draw},
         {"emitOnce", lua_ParticleEmitter_emitOnce},
         {"getAcceleration", lua_ParticleEmitter_getAcceleration},
@@ -31,6 +32,10 @@ void luaRegister_ParticleEmitter()
         {"getEnergyMax", lua_ParticleEmitter_getEnergyMax},
         {"getEnergyMin", lua_ParticleEmitter_getEnergyMin},
         {"getNode", lua_ParticleEmitter_getNode},
+        {"getOrbitAcceleration", lua_ParticleEmitter_getOrbitAcceleration},
+        {"getOrbitPosition", lua_ParticleEmitter_getOrbitPosition},
+        {"getOrbitVelocity", lua_ParticleEmitter_getOrbitVelocity},
+        {"getParticleCountMax", lua_ParticleEmitter_getParticleCountMax},
         {"getParticlesCount", lua_ParticleEmitter_getParticlesCount},
         {"getPosition", lua_ParticleEmitter_getPosition},
         {"getPositionVariance", lua_ParticleEmitter_getPositionVariance},
@@ -45,8 +50,13 @@ void luaRegister_ParticleEmitter()
         {"getSizeEndMin", lua_ParticleEmitter_getSizeEndMin},
         {"getSizeStartMax", lua_ParticleEmitter_getSizeStartMax},
         {"getSizeStartMin", lua_ParticleEmitter_getSizeStartMin},
+        {"getSpriteFrameCount", lua_ParticleEmitter_getSpriteFrameCount},
         {"getSpriteFrameDuration", lua_ParticleEmitter_getSpriteFrameDuration},
         {"getSpriteFrameRandomOffset", lua_ParticleEmitter_getSpriteFrameRandomOffset},
+        {"getSpriteHeight", lua_ParticleEmitter_getSpriteHeight},
+        {"getSpriteWidth", lua_ParticleEmitter_getSpriteWidth},
+        {"getTexture", lua_ParticleEmitter_getTexture},
+        {"getTextureBlending", lua_ParticleEmitter_getTextureBlending},
         {"getVelocity", lua_ParticleEmitter_getVelocity},
         {"getVelocityVariance", lua_ParticleEmitter_getVelocityVariance},
         {"isActive", lua_ParticleEmitter_isActive},
@@ -61,6 +71,7 @@ void luaRegister_ParticleEmitter()
         {"setEmissionRate", lua_ParticleEmitter_setEmissionRate},
         {"setEnergy", lua_ParticleEmitter_setEnergy},
         {"setOrbit", lua_ParticleEmitter_setOrbit},
+        {"setParticleCountMax", lua_ParticleEmitter_setParticleCountMax},
         {"setPosition", lua_ParticleEmitter_setPosition},
         {"setRotation", lua_ParticleEmitter_setRotation},
         {"setRotationPerParticle", lua_ParticleEmitter_setRotationPerParticle},
@@ -71,6 +82,7 @@ void luaRegister_ParticleEmitter()
         {"setSpriteFrameRandomOffset", lua_ParticleEmitter_setSpriteFrameRandomOffset},
         {"setSpriteLooped", lua_ParticleEmitter_setSpriteLooped},
         {"setSpriteTexCoords", lua_ParticleEmitter_setSpriteTexCoords},
+        {"setTexture", lua_ParticleEmitter_setTexture},
         {"setTextureBlending", lua_ParticleEmitter_setTextureBlending},
         {"setVelocity", lua_ParticleEmitter_setVelocity},
         {"start", lua_ParticleEmitter_start},
@@ -166,6 +178,50 @@ int lua_ParticleEmitter_addRef(lua_State* state)
     return 0;
 }
 
+int lua_ParticleEmitter_clone(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                ParticleEmitter* instance = getInstance(state);
+                void* returnPtr = (void*)instance->clone();
+                if (returnPtr)
+                {
+                    gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
+                    object->instance = returnPtr;
+                    object->owns = false;
+                    luaL_getmetatable(state, "ParticleEmitter");
+                    lua_setmetatable(state, -2);
+                }
+                else
+                {
+                    lua_pushnil(state);
+                }
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_ParticleEmitter_clone - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_ParticleEmitter_draw(lua_State* state)
 {
     // Get the number of parameters.
@@ -647,6 +703,146 @@ int lua_ParticleEmitter_getNode(lua_State* state)
     return 0;
 }
 
+int lua_ParticleEmitter_getOrbitAcceleration(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                ParticleEmitter* instance = getInstance(state);
+                bool result = instance->getOrbitAcceleration();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_ParticleEmitter_getOrbitAcceleration - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_ParticleEmitter_getOrbitPosition(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                ParticleEmitter* instance = getInstance(state);
+                bool result = instance->getOrbitPosition();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_ParticleEmitter_getOrbitPosition - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_ParticleEmitter_getOrbitVelocity(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                ParticleEmitter* instance = getInstance(state);
+                bool result = instance->getOrbitVelocity();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_ParticleEmitter_getOrbitVelocity - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_ParticleEmitter_getParticleCountMax(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                ParticleEmitter* instance = getInstance(state);
+                unsigned int result = instance->getParticleCountMax();
+
+                // Push the return value onto the stack.
+                lua_pushunsigned(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_ParticleEmitter_getParticleCountMax - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_ParticleEmitter_getParticlesCount(lua_State* state)
 {
     // Get the number of parameters.
@@ -1173,6 +1369,41 @@ int lua_ParticleEmitter_getSizeStartMin(lua_State* state)
     return 0;
 }
 
+int lua_ParticleEmitter_getSpriteFrameCount(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                ParticleEmitter* instance = getInstance(state);
+                unsigned int result = instance->getSpriteFrameCount();
+
+                // Push the return value onto the stack.
+                lua_pushunsigned(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_ParticleEmitter_getSpriteFrameCount - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_ParticleEmitter_getSpriteFrameDuration(lua_State* state)
 {
     // Get the number of parameters.
@@ -1243,6 +1474,155 @@ int lua_ParticleEmitter_getSpriteFrameRandomOffset(lua_State* state)
     return 0;
 }
 
+int lua_ParticleEmitter_getSpriteHeight(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                ParticleEmitter* instance = getInstance(state);
+                unsigned int result = instance->getSpriteHeight();
+
+                // Push the return value onto the stack.
+                lua_pushunsigned(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_ParticleEmitter_getSpriteHeight - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_ParticleEmitter_getSpriteWidth(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                ParticleEmitter* instance = getInstance(state);
+                unsigned int result = instance->getSpriteWidth();
+
+                // Push the return value onto the stack.
+                lua_pushunsigned(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_ParticleEmitter_getSpriteWidth - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_ParticleEmitter_getTexture(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                ParticleEmitter* instance = getInstance(state);
+                void* returnPtr = (void*)instance->getTexture();
+                if (returnPtr)
+                {
+                    gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
+                    object->instance = returnPtr;
+                    object->owns = false;
+                    luaL_getmetatable(state, "Texture");
+                    lua_setmetatable(state, -2);
+                }
+                else
+                {
+                    lua_pushnil(state);
+                }
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_ParticleEmitter_getTexture - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_ParticleEmitter_getTextureBlending(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                ParticleEmitter* instance = getInstance(state);
+                ParticleEmitter::TextureBlending result = instance->getTextureBlending();
+
+                // Push the return value onto the stack.
+                lua_pushstring(state, lua_stringFromEnum_ParticleEmitterTextureBlending(result));
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_ParticleEmitter_getTextureBlending - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_ParticleEmitter_getVelocity(lua_State* state)
 {
     // Get the number of parameters.
@@ -1818,6 +2198,42 @@ int lua_ParticleEmitter_setOrbit(lua_State* state)
     return 0;
 }
 
+int lua_ParticleEmitter_setParticleCountMax(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2);
+
+                ParticleEmitter* instance = getInstance(state);
+                instance->setParticleCountMax(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_ParticleEmitter_setParticleCountMax - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_ParticleEmitter_setPosition(lua_State* state)
 {
     // Get the number of parameters.
@@ -2277,6 +2693,71 @@ int lua_ParticleEmitter_setSpriteTexCoords(lua_State* state)
     return 0;
 }
 
+int lua_ParticleEmitter_setTexture(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 3:
+        {
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
+                    (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
+                {
+                    // Get parameter 1 off the stack.
+                    const char* param1 = gameplay::ScriptUtil::getString(2, false);
+
+                    // Get parameter 2 off the stack.
+                    ParticleEmitter::TextureBlending param2 = (ParticleEmitter::TextureBlending)lua_enumFromString_ParticleEmitterTextureBlending(luaL_checkstring(state, 3));
+
+                    ParticleEmitter* instance = getInstance(state);
+                    instance->setTexture(param1, param2);
+                    
+                    return 0;
+                }
+            } while (0);
+
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
+                    (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
+                {
+                    // Get parameter 1 off the stack.
+                    bool param1Valid;
+                    gameplay::ScriptUtil::LuaArray<Texture> param1 = gameplay::ScriptUtil::getObjectPointer<Texture>(2, "Texture", false, &param1Valid);
+                    if (!param1Valid)
+                        break;
+
+                    // Get parameter 2 off the stack.
+                    ParticleEmitter::TextureBlending param2 = (ParticleEmitter::TextureBlending)lua_enumFromString_ParticleEmitterTextureBlending(luaL_checkstring(state, 3));
+
+                    ParticleEmitter* instance = getInstance(state);
+                    instance->setTexture(param1, param2);
+                    
+                    return 0;
+                }
+            } while (0);
+
+            lua_pushstring(state, "lua_ParticleEmitter_setTexture - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 3).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_ParticleEmitter_setTextureBlending(lua_State* state)
 {
     // Get the number of parameters.

+ 12 - 0
gameplay/src/lua/lua_ParticleEmitter.h

@@ -7,6 +7,7 @@ namespace gameplay
 // Lua bindings for ParticleEmitter.
 int lua_ParticleEmitter__gc(lua_State* state);
 int lua_ParticleEmitter_addRef(lua_State* state);
+int lua_ParticleEmitter_clone(lua_State* state);
 int lua_ParticleEmitter_draw(lua_State* state);
 int lua_ParticleEmitter_emitOnce(lua_State* state);
 int lua_ParticleEmitter_getAcceleration(lua_State* state);
@@ -19,6 +20,10 @@ int lua_ParticleEmitter_getEmissionRate(lua_State* state);
 int lua_ParticleEmitter_getEnergyMax(lua_State* state);
 int lua_ParticleEmitter_getEnergyMin(lua_State* state);
 int lua_ParticleEmitter_getNode(lua_State* state);
+int lua_ParticleEmitter_getOrbitAcceleration(lua_State* state);
+int lua_ParticleEmitter_getOrbitPosition(lua_State* state);
+int lua_ParticleEmitter_getOrbitVelocity(lua_State* state);
+int lua_ParticleEmitter_getParticleCountMax(lua_State* state);
 int lua_ParticleEmitter_getParticlesCount(lua_State* state);
 int lua_ParticleEmitter_getPosition(lua_State* state);
 int lua_ParticleEmitter_getPositionVariance(lua_State* state);
@@ -33,8 +38,13 @@ int lua_ParticleEmitter_getSizeEndMax(lua_State* state);
 int lua_ParticleEmitter_getSizeEndMin(lua_State* state);
 int lua_ParticleEmitter_getSizeStartMax(lua_State* state);
 int lua_ParticleEmitter_getSizeStartMin(lua_State* state);
+int lua_ParticleEmitter_getSpriteFrameCount(lua_State* state);
 int lua_ParticleEmitter_getSpriteFrameDuration(lua_State* state);
 int lua_ParticleEmitter_getSpriteFrameRandomOffset(lua_State* state);
+int lua_ParticleEmitter_getSpriteHeight(lua_State* state);
+int lua_ParticleEmitter_getSpriteWidth(lua_State* state);
+int lua_ParticleEmitter_getTexture(lua_State* state);
+int lua_ParticleEmitter_getTextureBlending(lua_State* state);
 int lua_ParticleEmitter_getVelocity(lua_State* state);
 int lua_ParticleEmitter_getVelocityVariance(lua_State* state);
 int lua_ParticleEmitter_isActive(lua_State* state);
@@ -49,6 +59,7 @@ int lua_ParticleEmitter_setEllipsoid(lua_State* state);
 int lua_ParticleEmitter_setEmissionRate(lua_State* state);
 int lua_ParticleEmitter_setEnergy(lua_State* state);
 int lua_ParticleEmitter_setOrbit(lua_State* state);
+int lua_ParticleEmitter_setParticleCountMax(lua_State* state);
 int lua_ParticleEmitter_setPosition(lua_State* state);
 int lua_ParticleEmitter_setRotation(lua_State* state);
 int lua_ParticleEmitter_setRotationPerParticle(lua_State* state);
@@ -59,6 +70,7 @@ int lua_ParticleEmitter_setSpriteFrameDuration(lua_State* state);
 int lua_ParticleEmitter_setSpriteFrameRandomOffset(lua_State* state);
 int lua_ParticleEmitter_setSpriteLooped(lua_State* state);
 int lua_ParticleEmitter_setSpriteTexCoords(lua_State* state);
+int lua_ParticleEmitter_setTexture(lua_State* state);
 int lua_ParticleEmitter_setTextureBlending(lua_State* state);
 int lua_ParticleEmitter_setVelocity(lua_State* state);
 int lua_ParticleEmitter_start(lua_State* state);

+ 1 - 0
gameplay/src/lua/lua_Pass.cpp

@@ -14,6 +14,7 @@
 #include "lua_RenderStateBlend.h"
 #include "lua_RenderStateCullFaceSide.h"
 #include "lua_RenderStateDepthFunction.h"
+#include "lua_RenderStateFrontFace.h"
 #include "lua_RenderStateStencilFunction.h"
 #include "lua_RenderStateStencilOperation.h"
 

+ 68 - 2
gameplay/src/lua/lua_Properties.cpp

@@ -632,9 +632,50 @@ int lua_Properties_getNamespace(lua_State* state)
             lua_error(state);
             break;
         }
+        case 4:
+        {
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
+                    lua_type(state, 3) == LUA_TBOOLEAN &&
+                    lua_type(state, 4) == LUA_TBOOLEAN)
+                {
+                    // Get parameter 1 off the stack.
+                    const char* param1 = gameplay::ScriptUtil::getString(2, false);
+
+                    // Get parameter 2 off the stack.
+                    bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                    // Get parameter 3 off the stack.
+                    bool param3 = gameplay::ScriptUtil::luaCheckBool(state, 4);
+
+                    Properties* instance = getInstance(state);
+                    void* returnPtr = (void*)instance->getNamespace(param1, param2, param3);
+                    if (returnPtr)
+                    {
+                        gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
+                        object->instance = returnPtr;
+                        object->owns = false;
+                        luaL_getmetatable(state, "Properties");
+                        lua_setmetatable(state, -2);
+                    }
+                    else
+                    {
+                        lua_pushnil(state);
+                    }
+
+                    return 1;
+                }
+            } while (0);
+
+            lua_pushstring(state, "lua_Properties_getNamespace - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 1, 2 or 3).");
+            lua_pushstring(state, "Invalid number of parameters (expected 1, 2, 3 or 4).");
             lua_error(state);
             break;
         }
@@ -781,9 +822,34 @@ int lua_Properties_getString(lua_State* state)
             lua_error(state);
             break;
         }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
+                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                const char* param1 = gameplay::ScriptUtil::getString(2, false);
+
+                // Get parameter 2 off the stack.
+                const char* param2 = gameplay::ScriptUtil::getString(3, false);
+
+                Properties* instance = getInstance(state);
+                const char* result = instance->getString(param1, param2);
+
+                // Push the return value onto the stack.
+                lua_pushstring(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Properties_getString - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
+            lua_pushstring(state, "Invalid number of parameters (expected 1, 2 or 3).");
             lua_error(state);
             break;
         }

+ 367 - 24
gameplay/src/lua/lua_RadioButton.cpp

@@ -15,6 +15,7 @@
 #include "ScriptController.h"
 #include "ScriptTarget.h"
 #include "lua_ControlAlignment.h"
+#include "lua_ControlAutoSize.h"
 #include "lua_ControlListenerEventType.h"
 #include "lua_ControlState.h"
 #include "lua_CurveInterpolationType.h"
@@ -78,8 +79,12 @@ void luaRegister_RadioButton()
         {"getZIndex", lua_RadioButton_getZIndex},
         {"isContainer", lua_RadioButton_isContainer},
         {"isEnabled", lua_RadioButton_isEnabled},
+        {"isHeightPercentage", lua_RadioButton_isHeightPercentage},
         {"isSelected", lua_RadioButton_isSelected},
         {"isVisible", lua_RadioButton_isVisible},
+        {"isWidthPercentage", lua_RadioButton_isWidthPercentage},
+        {"isXPercentage", lua_RadioButton_isXPercentage},
+        {"isYPercentage", lua_RadioButton_isYPercentage},
         {"release", lua_RadioButton_release},
         {"removeListener", lua_RadioButton_removeListener},
         {"removeScriptCallback", lua_RadioButton_removeScriptCallback},
@@ -117,6 +122,8 @@ void luaRegister_RadioButton()
         {"setTextRightToLeft", lua_RadioButton_setTextRightToLeft},
         {"setVisible", lua_RadioButton_setVisible},
         {"setWidth", lua_RadioButton_setWidth},
+        {"setX", lua_RadioButton_setX},
+        {"setY", lua_RadioButton_setY},
         {"setZIndex", lua_RadioButton_setZIndex},
         {NULL, NULL}
     };
@@ -940,10 +947,10 @@ int lua_RadioButton_getAutoHeight(lua_State* state)
             if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
                 RadioButton* instance = getInstance(state);
-                bool result = instance->getAutoHeight();
+                Control::AutoSize result = instance->getAutoHeight();
 
                 // Push the return value onto the stack.
-                lua_pushboolean(state, result);
+                lua_pushstring(state, lua_stringFromEnum_ControlAutoSize(result));
 
                 return 1;
             }
@@ -975,10 +982,10 @@ int lua_RadioButton_getAutoWidth(lua_State* state)
             if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
                 RadioButton* instance = getInstance(state);
-                bool result = instance->getAutoWidth();
+                Control::AutoSize result = instance->getAutoWidth();
 
                 // Push the return value onto the stack.
-                lua_pushboolean(state, result);
+                lua_pushstring(state, lua_stringFromEnum_ControlAutoSize(result));
 
                 return 1;
             }
@@ -2724,6 +2731,41 @@ int lua_RadioButton_isEnabled(lua_State* state)
     return 0;
 }
 
+int lua_RadioButton_isHeightPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                RadioButton* instance = getInstance(state);
+                bool result = instance->isHeightPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_RadioButton_isHeightPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_RadioButton_isSelected(lua_State* state)
 {
     // Get the number of parameters.
@@ -2794,6 +2836,111 @@ int lua_RadioButton_isVisible(lua_State* state)
     return 0;
 }
 
+int lua_RadioButton_isWidthPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                RadioButton* instance = getInstance(state);
+                bool result = instance->isWidthPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_RadioButton_isWidthPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_RadioButton_isXPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                RadioButton* instance = getInstance(state);
+                bool result = instance->isXPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_RadioButton_isXPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_RadioButton_isYPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                RadioButton* instance = getInstance(state);
+                bool result = instance->isYPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_RadioButton_isYPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_RadioButton_release(lua_State* state)
 {
     // Get the number of parameters.
@@ -3032,17 +3179,35 @@ int lua_RadioButton_setAutoHeight(lua_State* state)
     {
         case 2:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                lua_type(state, 2) == LUA_TBOOLEAN)
+            do
             {
-                // Get parameter 1 off the stack.
-                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    lua_type(state, 2) == LUA_TBOOLEAN)
+                {
+                    // Get parameter 1 off the stack.
+                    bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
 
-                RadioButton* instance = getInstance(state);
-                instance->setAutoHeight(param1);
-                
-                return 0;
-            }
+                    RadioButton* instance = getInstance(state);
+                    instance->setAutoHeight(param1);
+                    
+                    return 0;
+                }
+            } while (0);
+
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
+                {
+                    // Get parameter 1 off the stack.
+                    Control::AutoSize param1 = (Control::AutoSize)lua_enumFromString_ControlAutoSize(luaL_checkstring(state, 2));
+
+                    RadioButton* instance = getInstance(state);
+                    instance->setAutoHeight(param1);
+                    
+                    return 0;
+                }
+            } while (0);
 
             lua_pushstring(state, "lua_RadioButton_setAutoHeight - Failed to match the given parameters to a valid function signature.");
             lua_error(state);
@@ -3068,17 +3233,35 @@ int lua_RadioButton_setAutoWidth(lua_State* state)
     {
         case 2:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                lua_type(state, 2) == LUA_TBOOLEAN)
+            do
             {
-                // Get parameter 1 off the stack.
-                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    lua_type(state, 2) == LUA_TBOOLEAN)
+                {
+                    // Get parameter 1 off the stack.
+                    bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
 
-                RadioButton* instance = getInstance(state);
-                instance->setAutoWidth(param1);
-                
-                return 0;
-            }
+                    RadioButton* instance = getInstance(state);
+                    instance->setAutoWidth(param1);
+                    
+                    return 0;
+                }
+            } while (0);
+
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
+                {
+                    // Get parameter 1 off the stack.
+                    Control::AutoSize param1 = (Control::AutoSize)lua_enumFromString_ControlAutoSize(luaL_checkstring(state, 2));
+
+                    RadioButton* instance = getInstance(state);
+                    instance->setAutoWidth(param1);
+                    
+                    return 0;
+                }
+            } while (0);
 
             lua_pushstring(state, "lua_RadioButton_setAutoWidth - Failed to match the given parameters to a valid function signature.");
             lua_error(state);
@@ -3608,9 +3791,31 @@ int lua_RadioButton_setHeight(lua_State* state)
             lua_error(state);
             break;
         }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                RadioButton* instance = getInstance(state);
+                instance->setHeight(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_RadioButton_setHeight - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
             lua_error(state);
             break;
         }
@@ -4586,9 +4791,147 @@ int lua_RadioButton_setWidth(lua_State* state)
             lua_error(state);
             break;
         }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                RadioButton* instance = getInstance(state);
+                instance->setWidth(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_RadioButton_setWidth - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_RadioButton_setX(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                RadioButton* instance = getInstance(state);
+                instance->setX(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_RadioButton_setX - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                RadioButton* instance = getInstance(state);
+                instance->setX(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_RadioButton_setX - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_RadioButton_setY(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                RadioButton* instance = getInstance(state);
+                instance->setY(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_RadioButton_setY - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                RadioButton* instance = getInstance(state);
+                instance->setY(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_RadioButton_setY - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
             lua_error(state);
             break;
         }

+ 6 - 0
gameplay/src/lua/lua_RadioButton.h

@@ -57,8 +57,12 @@ int lua_RadioButton_getY(lua_State* state);
 int lua_RadioButton_getZIndex(lua_State* state);
 int lua_RadioButton_isContainer(lua_State* state);
 int lua_RadioButton_isEnabled(lua_State* state);
+int lua_RadioButton_isHeightPercentage(lua_State* state);
 int lua_RadioButton_isSelected(lua_State* state);
 int lua_RadioButton_isVisible(lua_State* state);
+int lua_RadioButton_isWidthPercentage(lua_State* state);
+int lua_RadioButton_isXPercentage(lua_State* state);
+int lua_RadioButton_isYPercentage(lua_State* state);
 int lua_RadioButton_release(lua_State* state);
 int lua_RadioButton_removeListener(lua_State* state);
 int lua_RadioButton_removeScriptCallback(lua_State* state);
@@ -96,6 +100,8 @@ int lua_RadioButton_setTextColor(lua_State* state);
 int lua_RadioButton_setTextRightToLeft(lua_State* state);
 int lua_RadioButton_setVisible(lua_State* state);
 int lua_RadioButton_setWidth(lua_State* state);
+int lua_RadioButton_setX(lua_State* state);
+int lua_RadioButton_setY(lua_State* state);
 int lua_RadioButton_setZIndex(lua_State* state);
 int lua_RadioButton_static_ANIMATE_OPACITY(lua_State* state);
 int lua_RadioButton_static_ANIMATE_POSITION(lua_State* state);

+ 1 - 0
gameplay/src/lua/lua_RenderState.cpp

@@ -13,6 +13,7 @@
 #include "lua_RenderStateBlend.h"
 #include "lua_RenderStateCullFaceSide.h"
 #include "lua_RenderStateDepthFunction.h"
+#include "lua_RenderStateFrontFace.h"
 #include "lua_RenderStateStencilFunction.h"
 #include "lua_RenderStateStencilOperation.h"
 

+ 31 - 0
gameplay/src/lua/lua_RenderStateFrontFace.cpp

@@ -0,0 +1,31 @@
+#include "Base.h"
+#include "lua_RenderStateFrontFace.h"
+
+namespace gameplay
+{
+
+static const char* enumStringEmpty = "";
+
+static const char* luaEnumString_RenderStateFrontFace_FRONT_FACE_CW = "FRONT_FACE_CW";
+static const char* luaEnumString_RenderStateFrontFace_FRONT_FACE_CCW = "FRONT_FACE_CCW";
+
+RenderState::FrontFace lua_enumFromString_RenderStateFrontFace(const char* s)
+{
+    if (strcmp(s, luaEnumString_RenderStateFrontFace_FRONT_FACE_CW) == 0)
+        return RenderState::FRONT_FACE_CW;
+    if (strcmp(s, luaEnumString_RenderStateFrontFace_FRONT_FACE_CCW) == 0)
+        return RenderState::FRONT_FACE_CCW;
+    return RenderState::FRONT_FACE_CW;
+}
+
+const char* lua_stringFromEnum_RenderStateFrontFace(RenderState::FrontFace e)
+{
+    if (e == RenderState::FRONT_FACE_CW)
+        return luaEnumString_RenderStateFrontFace_FRONT_FACE_CW;
+    if (e == RenderState::FRONT_FACE_CCW)
+        return luaEnumString_RenderStateFrontFace_FRONT_FACE_CCW;
+    return enumStringEmpty;
+}
+
+}
+

+ 15 - 0
gameplay/src/lua/lua_RenderStateFrontFace.h

@@ -0,0 +1,15 @@
+#ifndef LUA_RENDERSTATEFRONTFACE_H_
+#define LUA_RENDERSTATEFRONTFACE_H_
+
+#include "RenderState.h"
+
+namespace gameplay
+{
+
+// Lua bindings for enum conversion functions for RenderState::FrontFace.
+RenderState::FrontFace lua_enumFromString_RenderStateFrontFace(const char* s);
+const char* lua_stringFromEnum_RenderStateFrontFace(RenderState::FrontFace e);
+
+}
+
+#endif

+ 38 - 0
gameplay/src/lua/lua_RenderStateStateBlock.cpp

@@ -13,6 +13,7 @@
 #include "lua_RenderStateBlend.h"
 #include "lua_RenderStateCullFaceSide.h"
 #include "lua_RenderStateDepthFunction.h"
+#include "lua_RenderStateFrontFace.h"
 #include "lua_RenderStateStencilFunction.h"
 #include "lua_RenderStateStencilOperation.h"
 
@@ -35,6 +36,7 @@ void luaRegister_RenderStateStateBlock()
         {"setDepthFunction", lua_RenderStateStateBlock_setDepthFunction},
         {"setDepthTest", lua_RenderStateStateBlock_setDepthTest},
         {"setDepthWrite", lua_RenderStateStateBlock_setDepthWrite},
+        {"setFrontFace", lua_RenderStateStateBlock_setFrontFace},
         {"setState", lua_RenderStateStateBlock_setState},
         {"setStencilFunction", lua_RenderStateStateBlock_setStencilFunction},
         {"setStencilOperation", lua_RenderStateStateBlock_setStencilOperation},
@@ -517,6 +519,42 @@ int lua_RenderStateStateBlock_setDepthWrite(lua_State* state)
     return 0;
 }
 
+int lua_RenderStateStateBlock_setFrontFace(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                RenderState::FrontFace param1 = (RenderState::FrontFace)lua_enumFromString_RenderStateFrontFace(luaL_checkstring(state, 2));
+
+                RenderState::StateBlock* instance = getInstance(state);
+                instance->setFrontFace(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_RenderStateStateBlock_setFrontFace - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_RenderStateStateBlock_setState(lua_State* state)
 {
     // Get the number of parameters.

+ 1 - 0
gameplay/src/lua/lua_RenderStateStateBlock.h

@@ -18,6 +18,7 @@ int lua_RenderStateStateBlock_setCullFaceSide(lua_State* state);
 int lua_RenderStateStateBlock_setDepthFunction(lua_State* state);
 int lua_RenderStateStateBlock_setDepthTest(lua_State* state);
 int lua_RenderStateStateBlock_setDepthWrite(lua_State* state);
+int lua_RenderStateStateBlock_setFrontFace(lua_State* state);
 int lua_RenderStateStateBlock_setState(lua_State* state);
 int lua_RenderStateStateBlock_setStencilFunction(lua_State* state);
 int lua_RenderStateStateBlock_setStencilOperation(lua_State* state);

+ 367 - 24
gameplay/src/lua/lua_Slider.cpp

@@ -13,6 +13,7 @@
 #include "ScriptTarget.h"
 #include "Slider.h"
 #include "lua_ControlAlignment.h"
+#include "lua_ControlAutoSize.h"
 #include "lua_ControlListenerEventType.h"
 #include "lua_ControlState.h"
 #include "lua_CurveInterpolationType.h"
@@ -80,8 +81,12 @@ void luaRegister_Slider()
         {"getZIndex", lua_Slider_getZIndex},
         {"isContainer", lua_Slider_isContainer},
         {"isEnabled", lua_Slider_isEnabled},
+        {"isHeightPercentage", lua_Slider_isHeightPercentage},
         {"isValueTextVisible", lua_Slider_isValueTextVisible},
         {"isVisible", lua_Slider_isVisible},
+        {"isWidthPercentage", lua_Slider_isWidthPercentage},
+        {"isXPercentage", lua_Slider_isXPercentage},
+        {"isYPercentage", lua_Slider_isYPercentage},
         {"release", lua_Slider_release},
         {"removeListener", lua_Slider_removeListener},
         {"removeScriptCallback", lua_Slider_removeScriptCallback},
@@ -123,6 +128,8 @@ void luaRegister_Slider()
         {"setValueTextVisible", lua_Slider_setValueTextVisible},
         {"setVisible", lua_Slider_setVisible},
         {"setWidth", lua_Slider_setWidth},
+        {"setX", lua_Slider_setX},
+        {"setY", lua_Slider_setY},
         {"setZIndex", lua_Slider_setZIndex},
         {NULL, NULL}
     };
@@ -946,10 +953,10 @@ int lua_Slider_getAutoHeight(lua_State* state)
             if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
                 Slider* instance = getInstance(state);
-                bool result = instance->getAutoHeight();
+                Control::AutoSize result = instance->getAutoHeight();
 
                 // Push the return value onto the stack.
-                lua_pushboolean(state, result);
+                lua_pushstring(state, lua_stringFromEnum_ControlAutoSize(result));
 
                 return 1;
             }
@@ -981,10 +988,10 @@ int lua_Slider_getAutoWidth(lua_State* state)
             if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
                 Slider* instance = getInstance(state);
-                bool result = instance->getAutoWidth();
+                Control::AutoSize result = instance->getAutoWidth();
 
                 // Push the return value onto the stack.
-                lua_pushboolean(state, result);
+                lua_pushstring(state, lua_stringFromEnum_ControlAutoSize(result));
 
                 return 1;
             }
@@ -2861,6 +2868,41 @@ int lua_Slider_isEnabled(lua_State* state)
     return 0;
 }
 
+int lua_Slider_isHeightPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Slider* instance = getInstance(state);
+                bool result = instance->isHeightPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Slider_isHeightPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Slider_isValueTextVisible(lua_State* state)
 {
     // Get the number of parameters.
@@ -2931,6 +2973,111 @@ int lua_Slider_isVisible(lua_State* state)
     return 0;
 }
 
+int lua_Slider_isWidthPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Slider* instance = getInstance(state);
+                bool result = instance->isWidthPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Slider_isWidthPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Slider_isXPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Slider* instance = getInstance(state);
+                bool result = instance->isXPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Slider_isXPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Slider_isYPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Slider* instance = getInstance(state);
+                bool result = instance->isYPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Slider_isYPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Slider_release(lua_State* state)
 {
     // Get the number of parameters.
@@ -3169,17 +3316,35 @@ int lua_Slider_setAutoHeight(lua_State* state)
     {
         case 2:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                lua_type(state, 2) == LUA_TBOOLEAN)
+            do
             {
-                // Get parameter 1 off the stack.
-                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    lua_type(state, 2) == LUA_TBOOLEAN)
+                {
+                    // Get parameter 1 off the stack.
+                    bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
 
-                Slider* instance = getInstance(state);
-                instance->setAutoHeight(param1);
-                
-                return 0;
-            }
+                    Slider* instance = getInstance(state);
+                    instance->setAutoHeight(param1);
+                    
+                    return 0;
+                }
+            } while (0);
+
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
+                {
+                    // Get parameter 1 off the stack.
+                    Control::AutoSize param1 = (Control::AutoSize)lua_enumFromString_ControlAutoSize(luaL_checkstring(state, 2));
+
+                    Slider* instance = getInstance(state);
+                    instance->setAutoHeight(param1);
+                    
+                    return 0;
+                }
+            } while (0);
 
             lua_pushstring(state, "lua_Slider_setAutoHeight - Failed to match the given parameters to a valid function signature.");
             lua_error(state);
@@ -3205,17 +3370,35 @@ int lua_Slider_setAutoWidth(lua_State* state)
     {
         case 2:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                lua_type(state, 2) == LUA_TBOOLEAN)
+            do
             {
-                // Get parameter 1 off the stack.
-                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    lua_type(state, 2) == LUA_TBOOLEAN)
+                {
+                    // Get parameter 1 off the stack.
+                    bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
 
-                Slider* instance = getInstance(state);
-                instance->setAutoWidth(param1);
-                
-                return 0;
-            }
+                    Slider* instance = getInstance(state);
+                    instance->setAutoWidth(param1);
+                    
+                    return 0;
+                }
+            } while (0);
+
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
+                {
+                    // Get parameter 1 off the stack.
+                    Control::AutoSize param1 = (Control::AutoSize)lua_enumFromString_ControlAutoSize(luaL_checkstring(state, 2));
+
+                    Slider* instance = getInstance(state);
+                    instance->setAutoWidth(param1);
+                    
+                    return 0;
+                }
+            } while (0);
 
             lua_pushstring(state, "lua_Slider_setAutoWidth - Failed to match the given parameters to a valid function signature.");
             lua_error(state);
@@ -3709,9 +3892,31 @@ int lua_Slider_setHeight(lua_State* state)
             lua_error(state);
             break;
         }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                Slider* instance = getInstance(state);
+                instance->setHeight(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Slider_setHeight - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
             lua_error(state);
             break;
         }
@@ -4863,9 +5068,147 @@ int lua_Slider_setWidth(lua_State* state)
             lua_error(state);
             break;
         }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                Slider* instance = getInstance(state);
+                instance->setWidth(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Slider_setWidth - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Slider_setX(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                Slider* instance = getInstance(state);
+                instance->setX(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Slider_setX - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                Slider* instance = getInstance(state);
+                instance->setX(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Slider_setX - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Slider_setY(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                Slider* instance = getInstance(state);
+                instance->setY(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Slider_setY - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                Slider* instance = getInstance(state);
+                instance->setY(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Slider_setY - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
             lua_error(state);
             break;
         }

+ 6 - 0
gameplay/src/lua/lua_Slider.h

@@ -61,8 +61,12 @@ int lua_Slider_getY(lua_State* state);
 int lua_Slider_getZIndex(lua_State* state);
 int lua_Slider_isContainer(lua_State* state);
 int lua_Slider_isEnabled(lua_State* state);
+int lua_Slider_isHeightPercentage(lua_State* state);
 int lua_Slider_isValueTextVisible(lua_State* state);
 int lua_Slider_isVisible(lua_State* state);
+int lua_Slider_isWidthPercentage(lua_State* state);
+int lua_Slider_isXPercentage(lua_State* state);
+int lua_Slider_isYPercentage(lua_State* state);
 int lua_Slider_release(lua_State* state);
 int lua_Slider_removeListener(lua_State* state);
 int lua_Slider_removeScriptCallback(lua_State* state);
@@ -104,6 +108,8 @@ int lua_Slider_setValueTextPrecision(lua_State* state);
 int lua_Slider_setValueTextVisible(lua_State* state);
 int lua_Slider_setVisible(lua_State* state);
 int lua_Slider_setWidth(lua_State* state);
+int lua_Slider_setX(lua_State* state);
+int lua_Slider_setY(lua_State* state);
 int lua_Slider_setZIndex(lua_State* state);
 int lua_Slider_static_ANIMATE_OPACITY(lua_State* state);
 int lua_Slider_static_ANIMATE_POSITION(lua_State* state);

+ 1 - 0
gameplay/src/lua/lua_Technique.cpp

@@ -14,6 +14,7 @@
 #include "lua_RenderStateBlend.h"
 #include "lua_RenderStateCullFaceSide.h"
 #include "lua_RenderStateDepthFunction.h"
+#include "lua_RenderStateFrontFace.h"
 #include "lua_RenderStateStencilFunction.h"
 #include "lua_RenderStateStencilOperation.h"
 

+ 367 - 24
gameplay/src/lua/lua_TextBox.cpp

@@ -13,6 +13,7 @@
 #include "ScriptTarget.h"
 #include "TextBox.h"
 #include "lua_ControlAlignment.h"
+#include "lua_ControlAutoSize.h"
 #include "lua_ControlListenerEventType.h"
 #include "lua_ControlState.h"
 #include "lua_CurveInterpolationType.h"
@@ -79,7 +80,11 @@ void luaRegister_TextBox()
         {"initialize", lua_TextBox_initialize},
         {"isContainer", lua_TextBox_isContainer},
         {"isEnabled", lua_TextBox_isEnabled},
+        {"isHeightPercentage", lua_TextBox_isHeightPercentage},
         {"isVisible", lua_TextBox_isVisible},
+        {"isWidthPercentage", lua_TextBox_isWidthPercentage},
+        {"isXPercentage", lua_TextBox_isXPercentage},
+        {"isYPercentage", lua_TextBox_isYPercentage},
         {"release", lua_TextBox_release},
         {"removeListener", lua_TextBox_removeListener},
         {"removeScriptCallback", lua_TextBox_removeScriptCallback},
@@ -116,6 +121,8 @@ void luaRegister_TextBox()
         {"setTextRightToLeft", lua_TextBox_setTextRightToLeft},
         {"setVisible", lua_TextBox_setVisible},
         {"setWidth", lua_TextBox_setWidth},
+        {"setX", lua_TextBox_setX},
+        {"setY", lua_TextBox_setY},
         {"setZIndex", lua_TextBox_setZIndex},
         {NULL, NULL}
     };
@@ -939,10 +946,10 @@ int lua_TextBox_getAutoHeight(lua_State* state)
             if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
                 TextBox* instance = getInstance(state);
-                bool result = instance->getAutoHeight();
+                Control::AutoSize result = instance->getAutoHeight();
 
                 // Push the return value onto the stack.
-                lua_pushboolean(state, result);
+                lua_pushstring(state, lua_stringFromEnum_ControlAutoSize(result));
 
                 return 1;
             }
@@ -974,10 +981,10 @@ int lua_TextBox_getAutoWidth(lua_State* state)
             if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
                 TextBox* instance = getInstance(state);
-                bool result = instance->getAutoWidth();
+                Control::AutoSize result = instance->getAutoWidth();
 
                 // Push the return value onto the stack.
-                lua_pushboolean(state, result);
+                lua_pushstring(state, lua_stringFromEnum_ControlAutoSize(result));
 
                 return 1;
             }
@@ -2801,6 +2808,41 @@ int lua_TextBox_isEnabled(lua_State* state)
     return 0;
 }
 
+int lua_TextBox_isHeightPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                TextBox* instance = getInstance(state);
+                bool result = instance->isHeightPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_TextBox_isHeightPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_TextBox_isVisible(lua_State* state)
 {
     // Get the number of parameters.
@@ -2836,6 +2878,111 @@ int lua_TextBox_isVisible(lua_State* state)
     return 0;
 }
 
+int lua_TextBox_isWidthPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                TextBox* instance = getInstance(state);
+                bool result = instance->isWidthPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_TextBox_isWidthPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_TextBox_isXPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                TextBox* instance = getInstance(state);
+                bool result = instance->isXPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_TextBox_isXPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_TextBox_isYPercentage(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                TextBox* instance = getInstance(state);
+                bool result = instance->isYPercentage();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_TextBox_isYPercentage - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_TextBox_release(lua_State* state)
 {
     // Get the number of parameters.
@@ -3074,17 +3221,35 @@ int lua_TextBox_setAutoHeight(lua_State* state)
     {
         case 2:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                lua_type(state, 2) == LUA_TBOOLEAN)
+            do
             {
-                // Get parameter 1 off the stack.
-                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    lua_type(state, 2) == LUA_TBOOLEAN)
+                {
+                    // Get parameter 1 off the stack.
+                    bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
 
-                TextBox* instance = getInstance(state);
-                instance->setAutoHeight(param1);
-                
-                return 0;
-            }
+                    TextBox* instance = getInstance(state);
+                    instance->setAutoHeight(param1);
+                    
+                    return 0;
+                }
+            } while (0);
+
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
+                {
+                    // Get parameter 1 off the stack.
+                    Control::AutoSize param1 = (Control::AutoSize)lua_enumFromString_ControlAutoSize(luaL_checkstring(state, 2));
+
+                    TextBox* instance = getInstance(state);
+                    instance->setAutoHeight(param1);
+                    
+                    return 0;
+                }
+            } while (0);
 
             lua_pushstring(state, "lua_TextBox_setAutoHeight - Failed to match the given parameters to a valid function signature.");
             lua_error(state);
@@ -3110,17 +3275,35 @@ int lua_TextBox_setAutoWidth(lua_State* state)
     {
         case 2:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                lua_type(state, 2) == LUA_TBOOLEAN)
+            do
             {
-                // Get parameter 1 off the stack.
-                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    lua_type(state, 2) == LUA_TBOOLEAN)
+                {
+                    // Get parameter 1 off the stack.
+                    bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
 
-                TextBox* instance = getInstance(state);
-                instance->setAutoWidth(param1);
-                
-                return 0;
-            }
+                    TextBox* instance = getInstance(state);
+                    instance->setAutoWidth(param1);
+                    
+                    return 0;
+                }
+            } while (0);
+
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                    (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
+                {
+                    // Get parameter 1 off the stack.
+                    Control::AutoSize param1 = (Control::AutoSize)lua_enumFromString_ControlAutoSize(luaL_checkstring(state, 2));
+
+                    TextBox* instance = getInstance(state);
+                    instance->setAutoWidth(param1);
+                    
+                    return 0;
+                }
+            } while (0);
 
             lua_pushstring(state, "lua_TextBox_setAutoWidth - Failed to match the given parameters to a valid function signature.");
             lua_error(state);
@@ -3614,9 +3797,31 @@ int lua_TextBox_setHeight(lua_State* state)
             lua_error(state);
             break;
         }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                TextBox* instance = getInstance(state);
+                instance->setHeight(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_TextBox_setHeight - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
             lua_error(state);
             break;
         }
@@ -4588,9 +4793,147 @@ int lua_TextBox_setWidth(lua_State* state)
             lua_error(state);
             break;
         }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                TextBox* instance = getInstance(state);
+                instance->setWidth(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_TextBox_setWidth - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_TextBox_setX(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                TextBox* instance = getInstance(state);
+                instance->setX(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_TextBox_setX - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                TextBox* instance = getInstance(state);
+                instance->setX(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_TextBox_setX - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_TextBox_setY(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                TextBox* instance = getInstance(state);
+                instance->setY(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_TextBox_setY - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER &&
+                lua_type(state, 3) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                float param1 = (float)luaL_checknumber(state, 2);
+
+                // Get parameter 2 off the stack.
+                bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 3);
+
+                TextBox* instance = getInstance(state);
+                instance->setY(param1, param2);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_TextBox_setY - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
             lua_error(state);
             break;
         }

+ 6 - 0
gameplay/src/lua/lua_TextBox.h

@@ -59,7 +59,11 @@ int lua_TextBox_getZIndex(lua_State* state);
 int lua_TextBox_initialize(lua_State* state);
 int lua_TextBox_isContainer(lua_State* state);
 int lua_TextBox_isEnabled(lua_State* state);
+int lua_TextBox_isHeightPercentage(lua_State* state);
 int lua_TextBox_isVisible(lua_State* state);
+int lua_TextBox_isWidthPercentage(lua_State* state);
+int lua_TextBox_isXPercentage(lua_State* state);
+int lua_TextBox_isYPercentage(lua_State* state);
 int lua_TextBox_release(lua_State* state);
 int lua_TextBox_removeListener(lua_State* state);
 int lua_TextBox_removeScriptCallback(lua_State* state);
@@ -96,6 +100,8 @@ int lua_TextBox_setTextColor(lua_State* state);
 int lua_TextBox_setTextRightToLeft(lua_State* state);
 int lua_TextBox_setVisible(lua_State* state);
 int lua_TextBox_setWidth(lua_State* state);
+int lua_TextBox_setX(lua_State* state);
+int lua_TextBox_setY(lua_State* state);
 int lua_TextBox_setZIndex(lua_State* state);
 int lua_TextBox_static_ANIMATE_OPACITY(lua_State* state);
 int lua_TextBox_static_ANIMATE_POSITION(lua_State* state);

+ 73 - 0
gameplay/src/lua/lua_VerticalLayout.cpp

@@ -20,9 +20,11 @@ void luaRegister_VerticalLayout()
         {"addRef", lua_VerticalLayout_addRef},
         {"getBottomToTop", lua_VerticalLayout_getBottomToTop},
         {"getRefCount", lua_VerticalLayout_getRefCount},
+        {"getSpacing", lua_VerticalLayout_getSpacing},
         {"getType", lua_VerticalLayout_getType},
         {"release", lua_VerticalLayout_release},
         {"setBottomToTop", lua_VerticalLayout_setBottomToTop},
+        {"setSpacing", lua_VerticalLayout_setSpacing},
         {NULL, NULL}
     };
     const luaL_Reg* lua_statics = NULL;
@@ -178,6 +180,41 @@ int lua_VerticalLayout_getRefCount(lua_State* state)
     return 0;
 }
 
+int lua_VerticalLayout_getSpacing(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                VerticalLayout* instance = getInstance(state);
+                int result = instance->getSpacing();
+
+                // Push the return value onto the stack.
+                lua_pushinteger(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_VerticalLayout_getSpacing - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_VerticalLayout_getType(lua_State* state)
 {
     // Get the number of parameters.
@@ -281,4 +318,40 @@ int lua_VerticalLayout_setBottomToTop(lua_State* state)
     return 0;
 }
 
+int lua_VerticalLayout_setSpacing(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                int param1 = (int)luaL_checkint(state, 2);
+
+                VerticalLayout* instance = getInstance(state);
+                instance->setSpacing(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_VerticalLayout_setSpacing - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 }

+ 2 - 0
gameplay/src/lua/lua_VerticalLayout.h

@@ -9,9 +9,11 @@ int lua_VerticalLayout__gc(lua_State* state);
 int lua_VerticalLayout_addRef(lua_State* state);
 int lua_VerticalLayout_getBottomToTop(lua_State* state);
 int lua_VerticalLayout_getRefCount(lua_State* state);
+int lua_VerticalLayout_getSpacing(lua_State* state);
 int lua_VerticalLayout_getType(lua_State* state);
 int lua_VerticalLayout_release(lua_State* state);
 int lua_VerticalLayout_setBottomToTop(lua_State* state);
+int lua_VerticalLayout_setSpacing(lua_State* state);
 
 void luaRegister_VerticalLayout();
 

+ 26 - 37
gameplay/src/social/GoogleGamesSocialSession.cpp → gameplay/src/social/GooglePlaySocialSession.cpp

@@ -1,7 +1,7 @@
 #if defined(__ANDROID__) && defined(GP_USE_SOCIAL)
 
 #include "Base.h"
-#include "GoogleGamesSocialSession.h"
+#include "GooglePlaySocialSession.h"
 #include <android_native_app_glue.h>
 #include <android/log.h>
 
@@ -10,9 +10,9 @@ namespace gameplay
 
 extern struct android_app* __state;
 
-GoogleGamesSocialSession* GoogleGamesSocialSession::_session = NULL;
+GooglePlaySocialSession* GooglePlaySocialSession::_session = NULL;
 
-GoogleGamesSocialSession::GoogleGamesSocialSession()
+GooglePlaySocialSession::GooglePlaySocialSession()
     : SocialSession(),
       _listener(NULL), _properties(NULL), _pendingUserResponse(false), _pendingFriendsResponse(false),
       _pendingScoresResponse(false), _pendingSubmitScoreResponse(false), _pendingAchievementResponse(false),
@@ -22,20 +22,20 @@ GoogleGamesSocialSession::GoogleGamesSocialSession()
     _userOp = USEROP_GET_LOCALUSER;
 }
 
-GoogleGamesSocialSession::~GoogleGamesSocialSession()
+GooglePlaySocialSession::~GooglePlaySocialSession()
 {
 }
 
-SocialSessionListener* GoogleGamesSocialSession::getListener()
+SocialSessionListener* GooglePlaySocialSession::getListener()
 {
     return _listener;
 }
 
-SocialSession *GoogleGamesSocialSession::authenticate(SocialSessionListener* listener, Properties* properties)
+SocialSession *GooglePlaySocialSession::authenticate(SocialSessionListener* listener, Properties* properties)
 {
     if (!_session)
     {
-		_session = new GoogleGamesSocialSession();
+		_session = new GooglePlaySocialSession();
 		_session->_listener = listener;
 		_session->_properties = properties;
 
@@ -75,7 +75,7 @@ SocialSession *GoogleGamesSocialSession::authenticate(SocialSessionListener* lis
     return _session;
 }
 
-const SocialPlayer& GoogleGamesSocialSession::getUser() const
+const SocialPlayer& GooglePlaySocialSession::getUser() const
 {
 	return _user;
 }
@@ -83,108 +83,97 @@ const SocialPlayer& GoogleGamesSocialSession::getUser() const
 /**
  * @see SocialSession::loadFriends
  */
-void GoogleGamesSocialSession::loadFriends()
+void GooglePlaySocialSession::loadFriends()
 {
-
 }
 
 /**
  * @see SocialSession::loadAchievements
  */
-void GoogleGamesSocialSession::loadAchievements()
+void GooglePlaySocialSession::loadAchievements()
 {
-
 }
 
 /**
  * @see SocialSession::submitAchievement
  */
-void GoogleGamesSocialSession::submitAchievement(const char* achievementId, unsigned int value, bool achieved=false)
+void GooglePlaySocialSession::submitAchievement(const char* achievementId, unsigned int value, bool achieved=false)
 {
-
 }
 
 /**
  * @see SocialSession::incrementAchievement
  */
-void GoogleGamesSocialSession::incrementAchievement(const char* achievementId, unsigned int increment=1)
+void GooglePlaySocialSession::incrementAchievement(const char* achievementId, unsigned int increment=1)
 {
-
 }
 
 /**
-  * @see SocialSession::syncAchievements
+  * @see SocialSession::synchronizeAchievements
   */
-void GoogleGamesSocialSession::synchronizeAchievements()
+void GooglePlaySocialSession::synchronizeAchievements()
 {
-
 }
 
 /**
  * @see SocialSession::loadScores
  */
-void GoogleGamesSocialSession::loadScores(const char* leaderboardId, SocialSession::CommunityScope community, SocialSession::TimeScope time, const SocialPlayer& player, unsigned int count)
+void GooglePlaySocialSession::loadScores(const char* leaderboardId, SocialSession::CommunityScope community, SocialSession::TimeScope time, const SocialPlayer& player, unsigned int count)
 {
-
 }
 
 /**
  * @see SocialSession::loadScores
  */
-void GoogleGamesSocialSession::loadScores(const char* leaderboardId, SocialSession::CommunityScope community, SocialSession::TimeScope time, unsigned int start, unsigned int count)
+void GooglePlaySocialSession::loadScores(const char* leaderboardId, SocialSession::CommunityScope community, SocialSession::TimeScope time, unsigned int start, unsigned int count)
 {
-
 }
 
 /**
  * @see SocialSession::submitScore
  */
-void GoogleGamesSocialSession::submitScore(const char* leaderboardId, float score)
+void GooglePlaySocialSession::submitScore(const char* leaderboardId, float score)
 {
-
 }
 
 /**
   * @see SocialSession::submitChallenge
   */
-void GoogleGamesSocialSession::submitChallenge(const SocialPlayer *player, unsigned int wager, float score, const char* leaderboardId=0)
+void GooglePlaySocialSession::submitChallenge(const SocialPlayer *player, unsigned int wager, float score, const char* leaderboardId=0)
 {
-
 }
 
 /**
   * @see SocialSession::loadChallenges
   */
-void GoogleGamesSocialSession::loadChallenges(bool showOpenChallengesOnly=true)
+void GooglePlaySocialSession::loadChallenges(bool showOpenChallengesOnly=true)
 {
-
 }
 
 /**
   * @see SocialSession::acceptChallenge
   */
-void GoogleGamesSocialSession::replyToChallenge(const SocialChallenge *challenge, bool accept)
+void GooglePlaySocialSession::replyToChallenge(const SocialChallenge *challenge, bool accept)
 {
-
 }
 
 /**
  * @see SocialSession::requestSavedData
  */
-void GoogleGamesSocialSession::loadSavedData(const char* key) {}
+void GooglePlaySocialSession::loadSavedData(const char* key) {}
 
 /**
  * @see SocialSession::submitSavedData
  */
-void GoogleGamesSocialSession::submitSavedData(const char* key, std::string data) {}
+void GooglePlaySocialSession::submitSavedData(const char* key, std::string data) {}
 
-void GoogleGamesSocialSession::displayLeaderboard(const char* leaderboardId) {}
+void GooglePlaySocialSession::displayLeaderboard(const char* leaderboardId) {}
 
-void GoogleGamesSocialSession::displayAchievements() {}
+void GooglePlaySocialSession::displayAchievements() {}
 
-void GoogleGamesSocialSession::displayChallenges() {}
+void GooglePlaySocialSession::displayChallenges() {}
 
-void GoogleGamesSocialSession::displayChallengeSubmit(const SocialChallenge *challenge, float score) {}
+void GooglePlaySocialSession::displayChallengeSubmit(const SocialChallenge *challenge, float score) {}
 
 
 }

+ 8 - 8
gameplay/src/social/GoogleGamesSocialSession.h → gameplay/src/social/GooglePlaySocialSession.h

@@ -1,7 +1,7 @@
 #if defined(__ANDROID__) && defined(GP_USE_SOCIAL)
 
-#ifndef GOOGLEGAMESSOCIALSESSION_H_
-#define GOOGLEGAMESSOCIALSESSION_H_
+#ifndef GOOGLEPLAYSOCIALSESSION_H_
+#define GOOGLEPLAYSOCIALSESSION_H_
 
 #include "SocialSession.h"
 
@@ -9,14 +9,14 @@ namespace gameplay
 {
 
 /**
- * Google Games implementation of SocialSession
+ * Google Play (game services) implementation of SocialSession
  *
  * Note: ensure game.config has the following properties
  *
   @verbatim
     social
     {
-         provider = GoogleGames
+         provider = GooglePlay
          id = d346c484-12aa-49a2-a0a0-de2f87492d72
          secret = aAa+DehBfyGO/CYaE3nWomgu7SIbWFczUih+Qwf3/n7u0y3nyq5Hag==
          version = 1.0
@@ -37,7 +37,7 @@ namespace gameplay
  *
  * @script{ignore}
  */
-class GoogleGamesSocialSession : public SocialSession
+class GooglePlaySocialSession : public SocialSession
 {
     friend class SocialController;
 
@@ -142,12 +142,12 @@ private:
     /**
      * Contructor
      */
-    GoogleGamesSocialSession();
+    GooglePlaySocialSession();
 
     /**
      * Destructor
      */
-    virtual ~GoogleGamesSocialSession();
+    virtual ~GooglePlaySocialSession();
 #if 0
 
     static void userCallback(void* cookie, unsigned int result);
@@ -168,7 +168,7 @@ private:
 
     SocialChallenge &addChallenge(SC_Challenge_h challenge);
 #endif
-    static GoogleGamesSocialSession* _session;
+    static GooglePlaySocialSession* _session;
 
     enum UserOp
     {

+ 1 - 1
samples/browser/res/common/forms/formSelect.form

@@ -14,7 +14,7 @@ form formSelect
 		text = Basic Controls
 		group = formSelection
 		size = 180, 60
-		textAlignment = ALIGN_VCENTER_HCENTER
+		textAlignment = ALIGN_VCENTER_LEFT
 		selected = true
 	}
 

+ 8 - 7
samples/browser/src/LightSample.cpp

@@ -91,6 +91,10 @@ void LightSample::initialize()
 	_pointLightNode->setTranslation(0.0f, 0.0f, 8.0f);
 	_scene->addNode(_pointLightNode);
 
+    // Create and initialize lights and materials for lights
+	_lighting = Material::create("res/common/light.material");
+	_model->setMaterial(_lighting);
+
     // Create and initialize ui form
 	_form = Form::create("res/common/light.form");
     _properties = static_cast<Container*>(_form->getControl("lightProperties"));
@@ -115,13 +119,6 @@ void LightSample::initialize()
 	_addBumped = static_cast<CheckBox*>(_form->getControl("bumpedCheckBox"));
 	_addBumped->addListener(this, Control::Listener::VALUE_CHANGED);
 
-    _properties->setEnabled(false);
-    _noLight->setSelected(true);
-	_form->setConsumeInputEvents(false);
-	
-    // Create and initialize lights and materials for lights
-	_lighting = Material::create("res/common/light.material");
-	_model->setMaterial(_lighting);
 	initializeDirectionalTechnique("directional");
 	initializeDirectionalTechnique("directionalSpecular");
 	initializeDirectionalTechnique("directionalBumped");
@@ -135,6 +132,10 @@ void LightSample::initialize()
 	initializePointTechnique("pointBumped");
 	initializePointTechnique("pointSpecularBumped");
 
+    _properties->setEnabled(false);
+    _noLight->setSelected(true);
+	_form->setConsumeInputEvents(false);
+
 	setSpecularValue(_specularSlider->getValue());
 }
 

+ 2 - 2
samples/browser/src/TextSample.cpp

@@ -99,8 +99,6 @@ void TextSample::render(float elapsedTime)
 
     _fonts[0]->drawText(fps, 245, 5, Vector4(0, 0.5f, 1, 1), _size);
     
-    _form->draw();
-
     if (_font != _fonts[0])
         _font->start();
 
@@ -139,6 +137,8 @@ void TextSample::render(float elapsedTime)
         _font->finish();
     }
     _fonts[0]->finish();
+
+    _form->draw();
 }
 
 void TextSample::touchEvent(Touch::TouchEvent event, int x, int y, unsigned int contactIndex)

+ 2 - 2
tools/luagen/gameplay-luagen.sln

@@ -1,6 +1,6 @@
 
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gameplay-luagen", "gameplay-luagen.vcxproj", "{CA137C5D-FDE1-4095-926A-59E8472504BF}"
 EndProject
 Global