Navigation

    CCBlueX Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    [Legendary] How to make an animation?

    ScriptAPI
    2
    6
    63
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • skidma
      skidma last edited by

      And so I know that with eventData.getPartialTicks() in render2D you can somehow make an animation, but how to do it?

      Asutoboki 1 Reply Last reply Reply Quote 0
      • Asutoboki
        Asutoboki @skidma last edited by

        @skidma wdym animation

        skidma 1 Reply Last reply Reply Quote 0
        • skidma
          skidma @Asutoboki last edited by

          @asutoboki-kun smooth rect animation

          Asutoboki 1 Reply Last reply Reply Quote 0
          • Asutoboki
            Asutoboki @skidma last edited by

            @skidma still can't get it

            skidma 1 Reply Last reply Reply Quote 0
            • skidma
              skidma @Asutoboki last edited by

              @asutoboki-kun dadad.png
              ZERODAY B20.6 RELEASED | HYPIXEL ZOOMING & BOOMING – 01:59
              — Intent Store

              (TargetHud health bar animation)

              Asutoboki 1 Reply Last reply Reply Quote 0
              • Asutoboki
                Asutoboki @skidma last edited by Asutoboki

                @skidma uh

                function animate(target, current, speed, partialTicks) {
                	dif = target - current;
                	if (speed < 0) {
                		speed = 0;
                	}
                	if (speed > 1) {
                		speed = 1;
                	}
                	factor = dif * speed * partialTicks;
                	if (target > current) {
                		current += factor;
                	} else {
                		current -= factor;
                	}
                	return current;
                }
                
                var shit;
                //...(the following lines of code will use Core)
                	
                	onRender2D: function(event) {
                		shit = animate(target_here, shit, speed_here, event.getPartialTicks());
                		//too lazy since it's late rn
                	}
                
                
                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Powered by NodeBB | Contributors