예제 #1
0
        public RichImageLayer_Texture(Texture2D aTexture, Color aColor, String aDrawMode, int aPadding, Rotation90 aRotation)
        {
            texture  = aTexture;
            color    = aColor;
            drawMode = drawModesByName[aDrawMode];
            padding  = aPadding;
            rotation = aRotation;
            offset   = Vector2.Zero;

            modifiesRect = (padding != 0 || offset.X != 0 || offset.Y != 0);
        }
예제 #2
0
        public RichImageLayer_Texture(JSONTable template, ContentManager content)
        {
            texture  = content.Load <Texture2D>(template.getString("texture", "white"));
            color    = template.getString("color", "FFFFFF").toColor();
            drawMode = drawModesByName[template.getString("draw", "default")];
            padding  = template.getInt("padding", 0);

            JSONArray offsetArray = template.getArray("offset", null);

            if (offsetArray == null)
            {
                offset = new Vector2(0, 0);
            }
            else
            {
                offset = offsetArray.toVector2();
            }

            rotation = template.getRotation("rotation", Rotation90.None);

            modifiesRect = (padding != 0 || offset.X != 0 || offset.Y != 0);
        }