Пример #1
0
    static int IntToEnum(IntPtr L)
    {
        int arg0 = (int)LuaDLL.lua_tonumber(L, 1);

        UIWidget.AspectRatioSource o = (UIWidget.AspectRatioSource)arg0;
        LuaScriptMgr.Push(L, o);
        return(1);
    }
Пример #2
0
        public static void Resize(this UISprite sp, UIWidget.AspectRatioSource aspectRatioSource, int size)
        {
            sp.keepAspectRatio = UIWidget.AspectRatioSource.Free;
            sp.MakePixelPerfect();
            sp.keepAspectRatio = aspectRatioSource;
            if (aspectRatioSource == UIWidget.AspectRatioSource.BasedOnWidth)
            {
                sp.width = size;
            }

            if (aspectRatioSource == UIWidget.AspectRatioSource.BasedOnHeight)
            {
                sp.height = size;
            }
        }
Пример #3
0
	static int get_keepAspectRatio(IntPtr L)
	{
		object o = null;

		try
		{
			o = ToLua.ToObject(L, 1);
			UIWidget obj = (UIWidget)o;
			UIWidget.AspectRatioSource ret = obj.keepAspectRatio;
			ToLua.Push(L, ret);
			return 1;
		}
		catch(Exception e)
		{
			return LuaDLL.toluaL_exception(L, e, o, "attempt to index keepAspectRatio on a nil value");
		}
	}
Пример #4
0
	static int set_keepAspectRatio(IntPtr L)
	{
		object o = null;

		try
		{
			o = ToLua.ToObject(L, 1);
			UIWidget obj = (UIWidget)o;
			UIWidget.AspectRatioSource arg0 = (UIWidget.AspectRatioSource)ToLua.CheckObject(L, 2, typeof(UIWidget.AspectRatioSource));
			obj.keepAspectRatio = arg0;
			return 0;
		}
		catch(Exception e)
		{
			return LuaDLL.toluaL_exception(L, e, o, "attempt to index keepAspectRatio on a nil value");
		}
	}