当前位置: 首页>>代码示例>>C#>>正文


C# com.getScaleX方法代码示例

本文整理汇总了C#中com.getScaleX方法的典型用法代码示例。如果您正苦于以下问题:C# com.getScaleX方法的具体用法?C# com.getScaleX怎么用?C# com.getScaleX使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com的用法示例。


在下文中一共展示了com.getScaleX方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: resolve

        public virtual void resolve(float x, float y, int chainLength, com.brashmonkey.spriter.objects.SpriterAbstractObject
			 effector)
        {
            float xx = effector.getX() + (float)System.Math.Cos(SpriterCalculator.DegreeToRadian(effector
                .getAngle())) * SpriterCalculator.BONE_LENGTH * effector
                .getScaleX();
            float yy = effector.getY() + (float)System.Math.Sin(SpriterCalculator.DegreeToRadian(effector
                .getAngle())) * SpriterCalculator.BONE_LENGTH * effector
                .getScaleX();
            effector.setAngle(com.brashmonkey.spriter.SpriterCalculator.angleBetween(effector
                .getX(), effector.getY(), x, y));
            if (this.player.getFlipX() == -1)
            {
                effector.setAngle(effector.getAngle() + 180f);
            }
            com.brashmonkey.spriter.objects.SpriterBone parent = null;
            if (effector.hasParent())
            {
                parent = player.getRuntimeBones()[effector.getParentId()];
                effector.copyValuesTo(temp);
                com.brashmonkey.spriter.SpriterCalculator.reTranslateRelative(parent, temp);
                if (effector is com.brashmonkey.spriter.objects.SpriterBone)
                {
                    temp.copyValuesTo(player.lastFrame.getBones()[effector.getId()]);
                }
                else
                {
                    temp.copyValuesTo(player.lastFrame.getObjects()[effector.getId()]);
                }
            }
            for (int i = 0; i < chainLength && parent != null; i++)
            {
                if (com.brashmonkey.spriter.SpriterCalculator.distanceBetween(xx, yy, x, y) <= 1)
                {
                    return;
                }
                parent.setAngle(parent.getAngle() + com.brashmonkey.spriter.SpriterCalculator.angleDifference
                    (com.brashmonkey.spriter.SpriterCalculator.angleBetween(parent.getX(), parent.getY
                    (), x, y), com.brashmonkey.spriter.SpriterCalculator.angleBetween(parent.getX(),
                    parent.getY(), xx, yy)));
                this.player.updateRecursively(parent);
                if (parent.hasParent())
                {
                    parent = player.getRuntimeBones()[parent.getParent().getId()];
                }
                else
                {
                    parent = null;
                }
                xx = effector.getX() + (float)System.Math.Cos(SpriterCalculator.DegreeToRadian(effector.getAngle
                    ())) * SpriterCalculator.BONE_LENGTH * effector.getScaleX
                    ();
                yy = effector.getY() + (float)System.Math.Sin(SpriterCalculator.DegreeToRadian(effector.getAngle
                    ())) * SpriterCalculator.BONE_LENGTH * effector.getScaleX
                    ();
            }
        }
开发者ID:Trixt0r,项目名称:SpriterXNATest,代码行数:57,代码来源:SpriterCCDResolver.cs

示例2: interpolateAbstractObject

        private void interpolateAbstractObject(com.brashmonkey.spriter.objects.SpriterAbstractObject
			 target, com.brashmonkey.spriter.objects.SpriterAbstractObject obj1, com.brashmonkey.spriter.objects.SpriterAbstractObject
			 obj2, float startTime, float endTime, float frame)
        {
            if (obj2 == null)
            {
                return;
            }
            target.setX(this.interpolate(obj1.getX(), obj2.getX(), startTime, endTime, frame)
                );
            target.setY(this.interpolate(obj1.getY(), obj2.getY(), startTime, endTime, frame)
                );
            target.setScaleX(this.interpolate(obj1.getScaleX(), obj2.getScaleX(), startTime,
                endTime, frame));
            target.setScaleY(this.interpolate(obj1.getScaleY(), obj2.getScaleY(), startTime,
                endTime, frame));
            target.setAngle(this.interpolateAngle(obj1.getAngle(), obj2.getAngle(), startTime
                , endTime, frame));
        }
开发者ID:Trixt0r,项目名称:SpriterXNATest,代码行数:19,代码来源:SpriterAnimationBuilder.cs

示例3: modObject

        private void modObject(com.brashmonkey.spriter.objects.SpriterAbstractObject @object
			)
        {
            @object.setAngle(@object.getAngle() + this.angle);
            @object.setScaleX(@object.getScaleX() * this.scaleX);
            @object.setScaleY(@object.getScaleY() * this.scaleY);
            @object.setX(@object.getX() + this.x);
            @object.setY(@object.getY() + this.y);
        }
开发者ID:Trixt0r,项目名称:SpriterXNATest,代码行数:9,代码来源:SpriterModObject.cs

示例4: translateRelative

        /// <summary>Rotates the given point around the given parent.</summary>
        /// <remarks>Rotates the given point around the given parent.</remarks>
        /// <param name="parent"></param>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="target">save new position in</param>
        public static void translateRelative(com.brashmonkey.spriter.objects.SpriterAbstractObject
			 parent, float x, float y, com.brashmonkey.spriter.objects.SpriterAbstractObject
			 target)
        {
            float px = x * (parent.getScaleX());
            float py = y * (parent.getScaleY());
            float s = (float)System.Math.Sin(DegreeToRadian(parent.getAngle()));
            float c = (float)System.Math.Cos(DegreeToRadian(parent.getAngle()));
            float xnew = (px * c) - (py * s);
            float ynew = (px * s) + (py * c);
            xnew += parent.getX();
            ynew += parent.getY();
            target.setX(xnew);
            target.setY(ynew);
        }
开发者ID:Trixt0r,项目名称:SpriterXNATest,代码行数:21,代码来源:SpriterCalculator.cs

示例5: reTranslateRelative

        public static void reTranslateRelative(com.brashmonkey.spriter.objects.SpriterAbstractObject
			 parent, float x, float y, com.brashmonkey.spriter.objects.SpriterAbstractObject
			 target)
        {
            target.setAngle(target.getAngle() - parent.getAngle());
            target.setScaleX(target.getScaleX() / parent.getScaleX());
            target.setScaleY(target.getScaleY() / parent.getScaleY());
            float xx = x - parent.getX();
            float yy = y - parent.getY();
            double angle = DegreeToRadian(parent.getAngle());
            float cos = (float)System.Math.Cos(angle);
            float sin = (float)System.Math.Sin(angle);
            float newX = yy * sin + xx * cos;
            float newY = yy * cos - xx * sin;
            target.setX(newX / parent.getScaleX());
            target.setY(newY / parent.getScaleY());
        }
开发者ID:Trixt0r,项目名称:SpriterXNATest,代码行数:17,代码来源:SpriterCalculator.cs

示例6: translateRelative

        private void translateRelative(com.brashmonkey.spriter.objects.SpriterAbstractObject
			 @object, com.brashmonkey.spriter.objects.SpriterAbstractObject parent)
        {
            @object.setAngle(@object.getAngle() * this.flippedX * this.flippedY + parent.getAngle()
                );
            @object.setScaleX(@object.getScaleX() * parent.getScaleX());
            @object.setScaleY(@object.getScaleY() * parent.getScaleY());
            com.brashmonkey.spriter.SpriterCalculator.translateRelative(parent, @object);
        }
开发者ID:Trixt0r,项目名称:SpriterXNATest,代码行数:9,代码来源:SpriterAbstractPlayer.cs


注:本文中的com.getScaleX方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。