Git Product home page Git Product logo

spriter-construct3's Introduction

C3SpriterPlugin

BrashMonkey's Construct 3 addon for c3runtime and c2runtime.

ISpriter documentation

This is the documentation to use Construct 3's new JavaScript Scripting feature with Spriter Pro.

Easy usage

You can easily access the Spriter object's interface using the runtime, from both the event sheet and script.

runtime.objects.Spriter.getFirstInstance().setAnimation("animationName", 0, 0);

For more information, please see the scripting documentation of the Sprite object.

Advanced usage

You can also subclass instances in a script, please see the subclassing instances documentation for more information.

class PlayerInstance extends ISpriterInstance
{
	constructor()
	{
		super();
	}
}

API

The supported methods and properties to use in Construct 3's scripting feature with Spriter Pro.

Globals

  • Context - retrieve the current instance of the Spriter object.

Actions

  • setPlaybackSpeedRatio(newSpeed)
  • setVisible(visible)
  • setOpacity(newOpacity)
  • setAutomaticPausing(newPauseSetting, leftBuffer, rightBuffer, topBuffer, bottomBuffer)
  • setObjectScaleRatio(newScale, xFlip, yFlip)
  • setObjectXFlip(xFlip)
  • setIgnoreGlobalTimeScale(ignore)
  • findSpriterObject(c2Object)
  • stopResumeSettingLayer(resume)
  • stopResumeSettingVisibilityForObjects(resume)
  • stopResumeSettingCollisionsForObjects(resume)
  • setObjectYFlip(yFlip)
  • setC2ObjectToSpriterObject(c2Object, propertiesToSet, spriterObjectName)
  • pinC2ObjectToSpriterObject(c2Object, propertiesToSet, spriterObjectName)
  • unpinC2ObjectFromSpriterObject(c2Object, spriterObjectName)
  • unpinAllFromSpriterObject(spriterObjectName)
  • setAnimation(animName, startFrom, blendDuration)
  • setSecondAnim(animName)
  • stopSecondAnim()
  • setAnimBlendRatio(newBlend)
  • setEnt(entName, animName)
  • playAnimTo(units, playTo)
  • associateTypeWithName(type, name)
  • setAnimationLoop(loopOn)
  • setAnimationTime(units, time)
  • pauseAnimation()
  • resumeAnimation()
  • removeAllCharMaps()
  • appendCharMap(mapName)
  • removeCharMap(mapName)
  • overrideObjectComponent(objectName, component, newValue)
  • overrideBonesWithIk(parentBoneName, childBoneName, targetX, targetY, additionalLength)

Conditions

  • readyForSetup()
  • outsidePaddedViewport()
  • actionPointExists (pointName)
  • objectExists (pointName)
  • tagActive (tagName, objectName)
  • CompareCurrentKey (cmp, frame)
  • CompareCurrentTime (cmp, time, format)
  • CompareAnimation (name)
  • CompareSecondAnimation (name)
  • CompareEntity (name)
  • AnimationPaused()
  • AnimationLooping()
  • isMirrored()
  • isFlipped()
  • CompareZElevation(which, comparison, z_elevation)

Expressions

  • time()
  • val(varname, objectName)
  • pointX(name)
  • pointY(name)
  • pointAngle(name)
  • objectX(name)
  • objectY(name)
  • objectAngle(name)
  • timeRatio()
  • ScaleRatio()
  • key()
  • PlayTo()
  • animationName()
  • animationLength()
  • speedRatio()
  • secondAnimationName()
  • entityName()
  • PlayToTimeLeft()
  • triggeredSound()
  • triggeredSoundTag()
  • soundVolume(soundTag)
  • soundPanning(soundTag)
  • blendRatio()
  • Opacity()
  • BBoxLeft()
  • BBoxTop()
  • BBoxRight()
  • BBoxBottom()
  • foundObject()
  • ZElevation()
  • TotalZElevation()

In-Progress

Currently unsupported methods and properties.

Actions

  • async LoadURL(url, crcrossOrigin)
  • async loadFromURL(url, crossOrigin, sconText)

Guide

The API documentation only shows the methods with its parameters, sometimes this is not enough to fully understand each use of the references. To solve that, use the official Spriter addon as reference.

image

Instructions

  • For text parameters, use string values.
  • For number parameters, use int or float values.
  • For combo parameters, use the placement of the drop-down selection, starting from 0.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.