![spine2d pop out window spine2d pop out window](https://i.ebayimg.com/images/g/a4sAAOSwP~tW13nn/s-l300.jpg)
G.rotate(bone.worldRotationX * flipX * flipY) G.translate(1000, 1600) // Set the position of the widget G.scale(wrapper.scaleX/4, wrapper.scaleY/4) Wrapper.scaleY = bone.worldScaleY * flipY Wrapper.scaleX = bone.worldScaleX * flipX I need to be able to set the wrapper's affine2d's x and y position, the the rotation by angle (ie. Var flipY : int = skeleton.flipY ? -1 : 1 Var flipX : int = skeleton.flipX ? -1 : 1 (0, 0) //(regionAttachment.x + shiftX * cos - shiftY * sin, -regionAttachment.y + shiftX * sin + shiftY * cos) ShiftX += regionHeight * (regionAttachment.width / region.width) (90) // Again, I need to += the rotation by 90 degrees, but I dont have that functionality Var shiftY : double = -regionAttachment.height / 2 * regionAttachment.scaleY Var shiftX : double = -regionAttachment.width / 2 * regionAttachment.scaleX Var radians : double = -regionAttachment.rotation * Math.PI / 180 Position using attachment translation, shifted as if scale and rotation were at image center (regionAttachment.scaleX * (regionAttachment.width / region.width), regionAttachment.scaleY * (regionAttachment.height / region.height)) (regionAttachment.rotation * Math.PI / 180) //This rotates the position of the drawn object, but I need to be able to set the actual rotation instead of translating a rotation
#Spine2d pop out window registration#
Rotate and scale using default registration point (top left corner, y-down, cw) instead of image center Var regionWidth : double = region.rotate ? region.height : region.width Var regionHeight : double = region.rotate ? region.width : region.height Var region : IGAtlasRegion = IGAtlasRegion(regionAttachment.rendererObject) Var wrapper : IGSpinePosition = m_wrappers Var regionAttachment : IGRegionAttachment = IGRegionAttachment(slot.attachment) If (slot.attachment != null & != IGRegionAttachment.Region()) Var drawOrder : Vector = skeleton.drawOrder įor (var i : int = 0 i < drawOrder.length i++) Protected override function render(g : IGGraphics) : void M_skeleton = new IGSkeleton(skeletonData) Public function IGSpineWidget (skeletonData : IGSkeletonData, image : IGImage) Private var m_wrappers : Map = new Map() // Works the same way as a Dictionary in AS3 Public class IGSpineWidget extends IGUIWidget These have the same functionality as the Spine2d library for AS3
#Spine2d pop out window code#
Any help would be immensely appreciated.Īt any rate, here is my code to render the actual spine library stuff (this is based off of the SkeletonSprite.as class from the AS3 library): package
![spine2d pop out window spine2d pop out window](https://i.ytimg.com/vi/Vz9AuQKxipE/maxresdefault.jpg)
All I need to be able to do is manually set the position by x and y, and manually set the rotation by angle. I've tried to wrap my head around it, but without much knowledge to how it works, I'm struggling to figure it out.
![spine2d pop out window spine2d pop out window](https://i.ytimg.com/vi/2MKS8rzKp-Y/maxresdefault.jpg)
The creators of this scripting language decided to use exclusively an affine coordinate space system to render positions and such. For the most part, it isn't too difficult, as our engine is similar enough to AS3 that I can just translate it over. So with this project, I was tasked with creating a Spine library for assistance with animation. Sparing the details, the engine basically interprets and exports as either Flash or iOS. For my current project, we are using a custom scripting language (God knows why we're doing that) for game development.