🤠
cedoscript
  • Introduction
  • Documentation
    • Packets
    • Setting Command
    • Java Imports
    • Examples
      • Creating a Pack
      • Custom Block Animation
      • Bhop
      • Setting Creation
      • Post Notification
      • Gradient Round Rectangle
      • Applying a gradient
      • Simulate a command
  • api
    • Events
    • Settings
    • Objects
      • EntityLivingBase
      • ItemStack
      • Player Abilities
      • Color
      • TimerUtil
      • Continual Animation
      • ShaderUtil
      • FrameBuffer
      • Rainbow
      • Drag
      • Pair
      • Module
  • Bindings
    • Client
    • Player
    • Packet
    • Action
    • Facing
    • Potion
    • Notification
    • Render
    • Stats
    • Font
    • User
    • World
Powered by GitBook
On this page
  • How to create
  • Functions
  • animate
  • getOutput
  • Usage

Was this helpful?

  1. api
  2. Objects

Continual Animation

This page explains the Continual Animation object

This object allows you to animate to certain endpoints

How to create

var anim = render.newContinualAnimation()

script.onRender2D(function(event) {
    
})

Functions

animate

anim.animate(endpoint, ms)
Parameter
Type
Description

endpoint

Number

The endpoint of the animation

ms

Number

Milliseconds of animation time

getOutput

anim.getOutput()

Returns the animation output as a Number

Usage

Used for health animation of a target

var anim = render.newContinualAnimation()

script.onRender2D(function (event) {
    var target = client.getAuraTarget()
    if (!target) return null
    var healthbarWidth = 100
    var healthPercentage = target.getHealth() / target.getMaxHealth()
    
    anim.animate(healthbarWidth * healthPercentage, 18)

    render.drawRect(100, 100, anim.getOutput(), 80, color({red: 255, green: 255, blue: 255}))

})
PreviousTimerUtilNextShaderUtil

Last updated 2 years ago

Was this helpful?