Example #1
0
        public override void SpawnSetup()
        {
            base.SpawnSetup();

            AnimatedGraphic animation = (AnimatedGraphic)base.Graphic;

            animation.DefaultFrame = 11;
        }
Example #2
0
        public static AnimatedGraphic FromSingleFrame(Graphic frame)
        {
            int    finalSlash = frame.path.LastIndexOf('/');
            string path       = frame.path.Substring(0, finalSlash);

            AnimatedGraphic anim = (AnimatedGraphic)GraphicDatabase.Get <AnimatedGraphic>(path, frame.shader, frame.drawSize, frame.color, frame.colorTwo);

            anim.DefaultFrame = Array.FindIndex(anim.subGraphics, row => row == frame);
            return(anim);
        }
Example #3
0
        public override void Tick()
        {
            base.Tick();

            CompPowerTrader power = GetComp <CompPowerTrader>();
            BeltComponent   belt  = GetComp <BeltComponent>();

            if (Graphic.GetType() == typeof(AnimatedGraphic))
            {
                AnimatedGraphic animation = (AnimatedGraphic)Graphic;

                if (animation.CurrentFrame != prevFrame)
                {
                    Find.MapDrawer.MapChanged(Position, MapChangeType.Things, true, false);
                    prevFrame = animation.CurrentFrame;
                }
            }
        }