dasneko Posted March 6, 2015 Share Posted March 6, 2015 I can't seem to find drawPath method in Graphics anymore. Looked through and it seem like it was there on 1.6 but no longer available since 2.0. Is there a replacement or a refactor? I am trying to convert this Flash code into Pixijs but it seem like I won't be able to use drawPath on the latest release. Can anyone point me in the right direction? I am fairly new on both Flash and Pixijs. Thank you very much in advanced.package { import flash.display.Sprite; import flash.display.Shape; import flash.events.Event; import fl.transitions.Tween; import flash.text.TextField; import flash.text.TextFormat; import flash.filters.DropShadowFilter; public class BrothTube extends Sprite { public var tween:Tween; public var broth:Sprite = new Sprite(); public var labelText:TextField = new TextField(); public var turbidShape:Shape = new Shape(); public var isMIC:Boolean = false; public var shadow1:DropShadowFilter = new DropShadowFilter(16, 45, 0, 1, 16, 16); public function BrothTube(turbid:Boolean = false):void { filters = [shadow1]; graphics.lineStyle(2, 0x808080); graphics.drawEllipse(0, 0, 50, 10); graphics.drawEllipse(0, 5, 50, 10); graphics.drawPath(Vector.<int>([1, 2, 3, 2]), Vector.<Number>([0,5, 0,200, 25,250, 50,200, 50,5])); broth.graphics.lineStyle(0, 0xCCCCCC); broth.graphics.drawPath(Vector.<int>([1, 2, 2, 2, 3]), Vector.<Number>([1,110, 1,500, 49,500, 49,110, 25,100, 1,110])); broth.graphics.lineStyle(0, 0xCCCCCC); broth.graphics.moveTo(1, 112); broth.graphics.curveTo(25,120, 49,112); broth.alpha = .5; addChild(broth); turbidShape.graphics.beginFill(0xFFCC80); turbidShape.graphics.drawPath(Vector.<int>([1, 2, 2, 2, 3]), Vector.<Number>([1,110, 1,500, 49,500, 49,110, 25,100, 1,110])); turbidShape.graphics.endFill(); turbidShape.alpha = 0; broth.addChild(turbidShape); var brothMask:Shape = new Shape(); brothMask.graphics.beginFill(0x000000); brothMask.graphics.drawEllipse(0, 0, 50, 10); brothMask.graphics.drawEllipse(0, 5, 50, 10); brothMask.graphics.drawPath(Vector.<int>([1, 2, 3, 2]), Vector.<Number>([0,5, 0,200, 25,250, 50,200, 50,5])); addChild(brothMask); broth.mask = brothMask; labelText.defaultTextFormat = new TextFormat("Arial", null, 0xFFFFFF, true, null, null, null, null, "center"); labelText.selectable = false; labelText.wordWrap = true; labelText.y = 260; labelText.width = 50; labelText.height = 50; labelText.alpha = 0; addChild(labelText); } }} dasneko 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.