Actionscript :: Flash LineStyle Rounds Thickness?

Feb 24, 2010

The sprite which contains all element in my game world uses the real-world meter as distance unit, it doesn't know what pixels are. I then apply a scale to this sprite to make it appear correct on screen. Currently I use 1 meter = 100 pixels, so scale = 100.

If I try to draw a line inside this sprite it appears lineStyle(thinkness) rounds the thickness parameter. If I specify 0.5 (50 cm) it always gets drawn with 1 pixel (1 cm). If I specify 0.6, the line becomes 100 pixels, or 1 meter, thick. So basically I can only draw lines of 1, 100, 200 etc pixels thinkness.

Anything I can do about this? Otherwise I'll have to use a smaller unit like millimeters for my world.

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Graphics.lineStyle() And Stroke Thickness?

Feb 3, 2009

Is there a way to draw a line with graphics.lineTo() that is thinner than 1point? According to the documentation the thinnest lineStyle possible should be 0 but I cannot see any difference between a 0 stroke and a 1 stroke?

View 4 Replies

Actionscript 3 :: Graphics - LineStyle Thickness To Fill A Circle?

May 19, 2010

i'm trying to build a circle using lines. each line starts in the centre of the circle and is as long as the circle's radius. using a loop along with sine and cosign waves, i can build the circle using the sine and cosign to mark the coordinates of the lineTo parameter.

my problem is with the line thickness parameter of lineStyle. i would like the ends of the lines to match up perfectly, no matter how big the circumference of the circle, but i can't figure out a proper method for the line thickness.

//this is what makes sense to me, but it still creates some gaps
lineThickness = 1 + (((nRadius * 2) * Math.PI) - 360) / 359;
for(var i:int = 0; i < 360; i++)

[code]....

to make the ends of the lines meet up at the circles circumference, without any gaps, i need to widen the lines to fill in the space that's remaining. what makes sense to me, but doesn't work, is to subtract the 360 from the circumference, then divide that number by the amount of empty slots between the lines (which is 359) and adding that number the the thickness of 1.

what's concerning me is that the lineStyle thickness parameter is a Number, but seems to take only values between 0 and 255, so i'm not sure if a floating point number like 1.354 is a valid thickness.

View 1 Replies

ActionScript 3.0 :: Creating Rounds In A Battle?

Mar 9, 2012

what would be the best way of creating rounds for a battle system? Say like with each attack a round goes by. rounds are not calculated at randomor player 1 hits player two = 1 round gone, now it's round two and so on until the player(s) hit points are all gone I'm using while loops for the record

View 3 Replies

Flash :: Fonts For Different Types Of Thickness?

Apr 21, 2011

This css can set style for all normal Arial, but I have Arial bold in project, how can I apply bold font for them?

@font-face {
src:url("fonts/ARIAL.TTF");
fontFamily: Arial;

[code].....

View 2 Replies

ActionScript :: Flash - Change Lines Thickness/color For Sprite/MovieClip?

Jun 10, 2011

I want to be able to change lines thickness/color for sprites/movieclips created in Flash CS in ActionScript code. Is it possible to achieve this kind of functionality?

View 2 Replies

IDE :: Make Flash Not Bother The Line Thickness When Changing Scale Or Some Sort Of Alternative?

Apr 11, 2012

I'm having an issue when it comes to line thickness on movie clips, when a movieclip is flipped the line thickness vanishes due to Flash thinking I'm squishing the MovieClip. Is there any way I can make Flash not bother the line thickness when changing scale or some sort of alternative? Or is my only choice to kill line thickness altogether.

View 1 Replies

IDE :: LineStyle In Z Space?

Oct 27, 2009

All i am looking for is to draw a line from point 1 x, y z, to point2 x y z Since this was CS 4 and z properties are enabled, i wonder how i could do this for a line.

View 3 Replies

ActionScript 3.0 :: Add Gradient On A Linestyle?

Dec 20, 2009

With linestyle, I can only specify a color unit value. How do I add a gradient to the line?

View 1 Replies

ActionScript 3.0 :: How To Snap Linestyle

Apr 11, 2011

i am trying to make a brush tool in actionscript 3, where kids can paint colors inside a circle using the brush. i have achieved this using linestyle. Now i want the brush to snap the color when the kid is about to complete(say when they are 95% to complete the painting). How do i know how much the kid has painted on the circle?

View 2 Replies

ActionScript 2.0 :: Dotted Line Through LineStyle?

Oct 12, 2007

Does anyone know if its possible to draw a dotted line through script?

View 5 Replies

ActionScript 3.0 :: Get Square Linestyle For DrawRect?

Jan 20, 2010

Normally when we draw a rectangle with linewidth 1 no problem.But if we apply a linewidth more than 10, the corners of rectangle seems rounded shape.[code]

View 2 Replies

ActionScript 2.0 :: Changing LineStyle On Rollover?

Jul 28, 2006

I have a box lined out by AS.

How can I change its lineStyle when rollOver, making it draker for example?

View 3 Replies

ActionScript 3.0 :: Using A Slider To Change Line Thickness?

Jan 16, 2010

trying to make a slider that changes the line thickness in a drawing app that I would to share with my students. When moved from left to right a circle changes scale. This circle would act as a visual reference on the stage telling the viewer that the line thickness is changing. Right now I just want to figure out how to connect the slider so that the circle changes dynamically. Once I get that I feel I can figure out how to connect it to lineStyle(). The current code I am attaching has the circle change size at onle two points-the far left and far right. I keep trying to write something that uses mouseX properties but so far nothing is working.

View 5 Replies

Flex :: Underline Line Thickness Always One Pixel?

Jan 17, 2010

Its an mx:Text object. (The Text object is actually being used as a mask so don't know if that's the problem.) If underline is set with the <u> tag in Text.htmlText, or Text.textField.setTextFormat, the underline thickness is always just one pixel which is not acceptable. (There are other problems with <u> so I'm limited to using setTextFormat currently.)

Can the thickness of an underline be set through CSS? (textField.styleSheet, etc.)

I may have another problem as I already use setTextFormat extensively, and the documentation says you can't use textField.setTextFormat if you use textField.setStyleSheet.

I primarily need the underline to simulate correctly the look for an anchor tag.

View 2 Replies

Actionscript 3 :: Change LineStyle Of Existing Line?

Mar 31, 2010

im drawing a line from 0,0 to 100,100 im using this to modify the linestyle:

draw_line.graphics.lineStyle(1, 0xFF0000);

That line is now of 1 thickness.Is there anyway i can change the thickness of the line to say 10, but without redrawing the line?

View 2 Replies

ActionScript 3.0 :: CS3 Linestyle / User Drawing With Variable

Feb 23, 2009

I'm attempting to make a very simple drawing programme. There will be maybe 4/5 buttons. Three of them when you click on the change the color of the line the user draws. the other two will change the line thickness. I've tried setting up a variable to set to how thick the line should be depending on the button the user has pressed.But it has no effect - i'm guessing that's because the variable only exists within the confines of the function that I have it in.[code]

View 1 Replies

ActionScript 3.0 :: Adding Gradient Fill On Linestyle?

Dec 18, 2009

How do I add gradient fill on a line (linestyle) rather than a box?

View 1 Replies

ActionScript 2.0 :: Drawing Box To Set Width / Height And LineStyle?

Mar 11, 2007

I was told to learn OOP, and here is my first class. It is to draw a box where you can set width, height, x, y, target movie clip, depth and lineStyle. I test my fla but it returns error on getLineStyle function.

View 3 Replies

ActionScript 2.0 :: Linestyle Does Not Support Bitmap Fill

Mar 21, 2007

I am creating the line trough "lineStyle" method but I need that instead of color on the fill I want to use an image.something like the beginBitmapFill well I tried everything and could not fin a solution for that.even the " lineGradientStyle" does not supprt the bitmap fill...

View 2 Replies

ActionScript 2.0 :: Editing Line Thickness Inside A Movieclip?

Oct 28, 2009

(Im using CS4 and actionscript 2)

I have some movieclips with a graph (not generated, manually drawn). I want to change the thickness of the line inside the movie clip. How do I do that?

When I move the mouse over the line the graph must highligt (become thicker). I can do this with the line as a button, mouse-over graphics. But I also need to highligt the graph when the mouse is over some text (to link the graph with the text). If I have 2 - or several - buttons can I have them all show the mouse-over image at the same time, if the mouse is over just one of them?

Another ideer: I have made an actionscript the fades (using alpha 0 and 100) for 2 similar movieclips each with different thickness positioned over each other. But the initial value for both lines is a problem, only the thin line must be shown, the thick line must be alpha=0. If I set it at the start of the actionscript then it resets every time the flash starts over. Is there some way to set the inital value (alpha=0) just once? When the flash playes first time?

View 1 Replies

Professional :: Changing The Thickness, Style And Colour For Each Of The Tools ?

Mar 14, 2012

Whenever i try to draw anthing (oval, box, pencil, brush) it just comes out as a thin green line. Ive tried the obvious by changing the thickness, style and colour for each of the tools but nothing seems to work.

View 3 Replies

ActionScript 3.0 :: Increasing Line Thickness Reduces Size Of Box

Sep 24, 2009

I made a small box that is filled with navy blue and has a red line around it, but when I increase the thickness to say 50, it reduces the size of my navy blue box.

PHP Code:
public class Box extends MovieClip {
public var color:uint = 0x000099; // class property of navy blue
public function Box() :void {
initialize();
construct();
this.graphics.lineStyle(50, 0xFF0000);
this.graphics.beginFill(color);
this.graphics.drawRect(0, 0, 100, 100);
this.graphics.endFill();
}

View 2 Replies

ActionScript 3.0 :: Control Line Thickness Via Mouse Speed

Feb 28, 2011

how can i control my line thickness with the speed of the cursor?Right now ive got this code, but how can i convert (speed) into something that can be translated into thickness?

ActionScript Code:
var prevPt:Point=new Point(mouseX,mouseY);
addEventListener(Event.ENTER_FRAME,mouseSpeed);
function mouseSpeed(e:Event){

[code]....

View 7 Replies

ActionScript 2.0 :: Paint Program - How To Change Thickness Of Line

May 23, 2005

Right now I create a paint program, which will consist of _xmouse, _ymouse, different colors to draw lines, different sizes. But I have a problem:
_root.line.lineStyle(size,0x00ff99,100);
The size is the thickness of the pen. But it don't seems to work inside of that script.

View 8 Replies

ActionScript 2.0 :: Changing The Thickness Of The Line Being Drawn At Runtime?

Apr 17, 2007

I am working on a interactivity wherien i draw lines using a pen/pencil just as in MsPaint application in Microsoft. Ia m done with the pencil/ pen tool and its working fine but I basically want to change the thickness of the line at runtime by using a slider functionality.

Code:

drawing_mc.lineStyle(1, 0x99CC00, 100);

View 1 Replies

Actionscript 3 :: Graphics - LineStyle Color Changing Prematurely

Jun 29, 2010

i'm attempting to draw lines beside each other, but the last line from the first color group takes on the color from the second color group before the second color is assigned.

[Code]...

View 2 Replies

ActionScript 3 :: Change LineStyle From Graphics Into MovieClip Dynamically?

Dec 5, 2011

I draw a line using "graphics.lineTo" into a movieclip and I need to change my linestyle if the user ask for that throw a button in runtime. I can change the color, but I can't change the linestyle...Is there someway to change it?

View 1 Replies

ActionScript 2.0 :: Drawing API - Changing LineStyle To Paint Brush

Mar 16, 2010

I have a drawing api with the simple code of a flash:
Code:
stop();
this.createEmptyMovieClip("dibujo", 1);
dibujo.lineStyle(4, 0x000FFF, 100);
attachMovie("lapiz", "lapiz", 11);
[Code] .....
But I need a more complex lineStyle, I mean, a brush that look like a paint brush, like water color.

View 0 Replies

ActionScript 3.0 :: Increase/decrease The Stroke To A Specific Thickness In Pixels?

Oct 12, 2009

So, I have a movie clip which consists of a filled vector circle with a stroke. Is it possible to increase/decrease the stroke to a specific thickness in pixels with actionscript whilst the swf is playing?

View 5 Replies







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