ActionScript 3.0 :: Draw Points With DrawGraphicsData With An Offset?

Jul 3, 2011

I'm projecting some vectors using the Utils3D.projectVectors() method. This gives me the (x,y) screen points. Then I'm using graphics.drawGraphicsData(); to draw a GraphicsTrianglePath containing these points.

The points are drawn at the top left (0,0) of the stage, but I want them to be at the middle (275,200). I know there are several ways of doing this, like for instance, adding 275 to all the screen points x values, and adding 200 to the y values, but I think that would be a massive operation.I can also set the sprite containers x and y, but I want its position to stay in the top left.

Simple way of drawing it in the middle?

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Draw A Plane Between The Known Points?

Jun 22, 2010

I have an array of points and I need square planes to be drawn between these points and distorted if points change their coordinates (see what I mean in the attached file).So what is the best practice I should use to create such set of planes knowing just coordinates of the points (planes vertices)?

View 4 Replies

ActionScript 3.0 :: Draw Beizer Through N Points?

Sep 13, 2011

I am looking to draw a curve through N points. The control points will be constantly moving so ill need to keep updating the line ON_ENTER_FRAME.I have looked on Google, and i found some dedicated libraries,URL...But i dont have a clue how to use it.Does anyone have any advice for me on how to draw the curve?

View 2 Replies

Flex :: Draw Custom Bullet Points?

Mar 29, 2010

how I can draw Bullet Points using Flex? instead of using image for 1, 2 and 3?

View 2 Replies

Draw A Continuous Curved Line From 3 Given Points At A Time?

May 10, 2011

I am trying to draw a continuous curved line in flash. There are many methods but none of the ones I have found so far quite fit my requirements. First of all, I want to use the flash graphic api's curveTo() method. I DO NOT want to simulate a curve with hundreds of calls to lineTo() per curved line segment. It is my experience and understanding that line segments are processor heavy. Flash's quadratic bezier curve should take less CPU power. [code]...

View 3 Replies

Flash - Why Doesn't This Circle Draw All The Points Correctly

Dec 28, 2011

I'm having issues with drawing a circle. The code seems to work for drawing all the required segments except one, but tracing the points of the drawing looks correct.This is the class that generates the segments:

package views
{
import flash.display.Sprite;
import flash.geom.Point;

[code]....

View 1 Replies

Actionscript 3.0 :: Draw Outline Of Object Or Get Bezier Points?

Jan 10, 2009

I am struggling with an issue where I want to create a function that draws an outline of any object and I want to use this outline as curve path so I can animate objects on this path using Tweener. Like that:

Code: Select allvar path = new Array();
path.push({x:300, y:0});
path.push({x:200, y:400});

[code].....

View 4 Replies

ActionScript 2.0 :: Draw Curve Through 3 Points (not Control Point)

Feb 3, 2005

I'm attempting to make a curve drawing tool a bit easier to use.Rather than drawing a basic curve and then clicking on the control point to change it, I would like the user to be able to click on the curve itself to change it, much as you do in the FlashIDE.So, given start and end points, and a point on the curve, how do you determine the control point for use with the MX API?(I googled this, but found mostly info on cubic rather than quadratic curves)

View 3 Replies

ActionScript 2.0 :: Draw Curve Through 3 Points (not The Control Point)?

Feb 3, 2005

I'm attempting to make a curve drawing tool a bit easier to use. Rather than drawing a basic curve and then clicking on the control point to change it, I would like the user to be able to click on the curve itself to change it, much as you do in the FlashIDE.

So, given start and end points, and a point on the curve, how do you determine the control point for use with the MX API?

View 4 Replies

Actionscript :: Draw Sprites To A BitmapData When They Have Crazy Origin Points?

Feb 9, 2012

I am facing a real nightmare. I have many Assets which use strange origin points. I need to essentially draw these assets to a BitmapData, but the origin point causes all kinds of problems. StackOVerflow does not let me attach an image so I will try to describe. Imagine you have the shape of a digit "8". You have 3 of these shapes.... Each shape has a different origin:

1) The middle of the "8" shape

2) The centre of the top "o" part of the "8" shape

3) The centre of the bottom "o" part of the "8" shape

How, with a single drawing routine, can I correctly draw each of these instances to a BitmapData? Ideally I want to find the top left part of any Sprite bounding box, and bitmapdata.draw() from there. But after 2 days, all of my attempts either get clipped.... or using matrices, they do not work for every origin point and different drawings get clipped in different locations.

View 1 Replies

ActionScript 3.0 :: 'drawGraphicsData' Line Won't Terminate?

Mar 15, 2011

The fills behave as expected but I can't get the stroke to break. For some reason it ends up connecting back to it's first coordinate. I've attached an image illustrating the problem.Here's the code:

ActionScript Code:
import flash.display.GraphicsPath;
import flash.display.GraphicsPathCommand;

[code]......

View 0 Replies

ActionScript 3.0 :: Access The Product Of DrawGraphicsData()?

Feb 21, 2010

If I use the code below I end up with a square. Good. But how do I access that square? say to change its x and y values, or even just to make it a child of a sprite?

Code:
// establish the fill properties
var myFill:GraphicsGradientFill = new GraphicsGradientFill();

[code].....

View 4 Replies

Actionscript 3 :: Calculating Evenly Distributed Points On A Line Of Points

Oct 3, 2011

I have been tasked with trying to create a drawing tool that draws dotted lines as you drag the mouse across the stage. I can easily capture the points on MouseEvent.MOUSE_MOVE and store them in a vector and then draw the points as dots:

The problem is that I need to calculate evenly distributed points on an ever growing Vector of points so I can only draw the line between say every 5th point (say using modulus). I have been battling away with Bezier curve equations both Quadratic and Cubic but still can't quite figure out how to convert my Vector of points into an evenly distributed Vector of Points without sucking the life from the CPU.

View 1 Replies

ActionScript 3.0 :: Ludicrous HtmlText Offset?

Aug 4, 2009

so I'm working on an app requiring me to lay some simple HTML as multicolumn text, and hacking around w/ g.skinner's old regexp method of reflowing as3 TextFields. I'll be happy to share this code if I can get it working. No desire to get into screwing with text.engine at this point, and this has to be back compatible to FP9 anyway.

So I'm back-and-forth parsing from likely break points to determine if we're in a tag here, and jump ahead to the end of it if we are. The ridiculous issue I'm up against is simply that there doesn't seem to be a TextField method for getting the htmlText offset -- NOT the visible text offset -- of a character. Is there a way to do that?

View 12 Replies

Actionscript 3 :: Finding The Offset Of A Block?

Jan 2, 2011

I am trying to make a pong like game but i need to find the offset from the center of the paddle so that i can make it bounce differently depending on where it hits the paddle. How can i achieve this?

View 1 Replies

Actionscript 3 :: Strange Offset In Flash?

Dec 14, 2011

I need to check (for my own good reasons) whether the cursor is located within the bounds of a particular object. I'm using a simple code to do this...

if(mouseX > hsSlot1.x && mouseX < (hsSlot1.x + hsSlot1.width) && mouseY > hsSlot1.y && mouseY < (hsSlot1.y + hsSlot1.height))
{
//My code
}

This, theoretically, should work perfectly! However, there is an offset (and one I did NOT set, mind you!) of about 16 between the hsSlot1's visual position (where it appears to start on the screen) and hsSlot1.x. There is a similar offset on the y axis, but I haven't measured it yet.The only thing I can think of for this is that hsSlot1 is an instance of a button (one with only one state at that) that was scaled to fit. However, I don't think that is it, because the numbers show that the entire object is merely offset at its current size.

View 2 Replies

ActionScript 3.0 :: A Gradual Offset Of A MC (using Loops)?

Jun 14, 2010

im trying to actionscript a simple animation where a combination of MC's move towards areas on the screen triggred by mouse events.What would be the best way of gradually ofsetting a MC, with the control to stop them with further mouse events.I have used tweens (example below) but i need to be able to stop them mid tween, i have tried using if statement to stop the clip but i cant seem to overide the tween.I have limited experience but im guessing a time based loop that i could supply an if statement withbooleons would be my answer. Are time loops possible with actionscript 3.(my thinking is(mouse event. start time based loop -offseting MC- Mouse Event 2 stops loop with if. )

tween example i used
(function moveToLeft(event:MouseEvent):void {
xMovement = new Tween(walkMC, "x", None.easeOut, walkMC.x, mouseX, 8, true); )

ive found the timer class, i should be able to make summit work with this

View 3 Replies

ActionScript 2.0 :: Center Offset From Edge?

Sep 1, 2010

How do I determine where an MC's center is relative to its edges?

I'm developing a tool that a variety of noobs (as if I'm not still a noob) will be using, and I don't trust them to keep art with 0,0 being the top left corner.

How do I figure out that the left edge is now at -111px, and the top at -52, and the right at 12, and the bottom at 334?

Or what if they draw it so the left edge is at 56px and the right edge at 583?

Essentially, I want to determine the center of my artwork, wherever it is relative to the center of the MC

View 1 Replies

ActionScript 3.0 :: Revolving Around Point With Offset

Dec 30, 2011

I got a bit of code, need head the arrow towards mouseX and mouseY. Everything almost done, but I get some shaky effect if mouse is too close to the object. Just look into .fla.

View 0 Replies

Flex :: Handling Timezone Offset?

Jun 28, 2011

I've developed an FLEX application for distributed data administration. When our Asian employees specify a date, it will be saved +1 day.If I check my timezone offset it is +60, their offset is +520.

var dNow:Date = new Date();
trace("Your time zone offset: " + dNow.getTimezoneOffset() + " minutes");

I assume this is the problem? If so, would you suggest that I correct the entered date by 460 minutes before sending it to our server for saving? How to do that?

View 2 Replies

ActionScript 3.0 :: Flash Rotate Is Offset

Mar 2, 2011

I`m making a game where the player follows the mouse and shoots towards it. But I realized the laser-thing didn`t seem to be coming straight from the player. So I added a line going strait up and down on the player movie clip, and it seems that the rotate code is slightly offset.

[Code]...

View 1 Replies

ActionScript 3.0 :: Scrolling Thumbs Gallery Offset

Oct 15, 2010

i'm currently re-using a code snippet of xml gallery with scrolling thumbs, but i got a problem : my mask is stagewidth and my pictures holder depend of thumbs numbers, sometimes after resizing windows browser, while scrolling to the browser sides limit i cannot see the end of the last pic or the start of the first pic

[Code].....

View 7 Replies

ActionScript 1/2 :: Creating A CLOCK OFFSET Option

Feb 7, 2012

I am programming an instrument that has a feature for the user to offset the clock by the timezone that they are in. I have your basic clock functioning and give the users the ability to select their clock offset and store both the offset Hours and the Minutes in separate variables... My question is how to i take these variables and have them calculate/ update this standard clock function that i am using below:

[Code]...

View 1 Replies

Flex :: Mystery Coordinate Offset On GetCharBoundaries?

Jun 19, 2009

I've ran into a weird problem with getCharBoundaries, I could not figure out what coordinate space the coordinates returned from the function was in. What ever I tried I could not get it to match up with what I expected. So I made a new project and and added simple code to highlight the last charater in a textfield, and all of a sudden it worked fine. I then tried to copy over the TextField that had been causing me problems, into the new project. And now the same weird offset appeared 50px on the x axis.Everything else was spot on. So after some headscracthing comparing the two TextFields, I simply can not see a difference in their properties or transformation.

So I was hoping that someone might now what property might affect the coordinates returned by getCharBoundaries.

View 4 Replies

Flex3 - Skinned Panel Content Offset?

Sep 5, 2009

Here is the problem. I've created custom RectangularBorder and set it as border skin for TitleWindow. After this manipulation inner content of window is starting at 0,0 point of it. How could I set offset of it?

Just setting top padding does not work because scroll bar still begins from the top of the window after this manipulation.

View 3 Replies

ActionScript 2.0 :: Offset Working Mouse Follower

Dec 31, 2002

I have succesfully achieved a mouse follower using the following code, [code]the part I need to understand how to change is:I want to offset the MC in relation to the mouse pointer,probably by assigning variables, not sure though.

View 3 Replies

ActionScript 2.0 :: Shape Movement Vs Camera Offset FLA's

Jun 1, 2006

Ive been looking at the following tutorial: [URK] but i can't seem to get it to work. If anyone has completed this tutorial, is there any chance of you uploading the fla for me to play with...?? Im trying to use the Star/Space effect located at the bottom of the page.

View 2 Replies

ActionScript 2.0 :: Random Motion Offset To Bottom Right?

Jun 11, 2003

I've cut and pasted the random motion tutorial code into my movie, and for some reason the movie clips that are moving migrate to the bottom right off the movie, off-stage. I've tried setting the registration point of the movie to the upper left, but that didn't help.

View 3 Replies

ActionScript 3.0 :: Bug: Flash Embed Offset On Page?

Sep 8, 2010

This might be more of a Safari thing rather than Flash being that I've not seen this happen on any other browser or OS, but would anyone have any idea why this Flash embed of our player is offset as it is in Safari:?

[URL]

Here's a screenshot of what it looks like for those not in Safari:The weird thing is that it seems to only be *visually* offset; that is, if you roll over the area with your mouse, you'll see that it interacts as if it's in the right place and not offset; the browser treats it like it's in the right place, but it's visually offset to the top-left some dozens of pixels...

View 2 Replies

ActionScript 3.0 :: Scrolling Thumbs Gallery Offset?

Nov 19, 2010

i'm currently re-using a code snippet of xml gallery with scrolling thumbs, but i got a problem : my mask is stagewidth and my pictures holder width depend of thumbs numbers, sometimes after resizing windows browser, while scrolling to the browser sides limit i cannot see the end of the last pic or the start of the first pic, how to fix that ?

tha'ts part of a bigger project, but i've isolated the bug in this source : [URL]

the fix i would like :

-seeing the whole first pic and whole last pic when scrolling to the border left and right

-placing the first pic at x:70 at start, and enter fullscreen

if someone may have a look on this , that's only a 2 mn fix for a skilled as3 programmer, but for me a headache

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved