Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jul 2006
    Posts
    138
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Wrong line height

    Hello I am having a simple problem

    Code:
    
    	  var rectHeight = 37;
    	  
    	  var rectWidth = 37;
    
    		tmp_big.lineStyle(rectWidth,color_tmp,100,true,"none","square", 1);
    	  	tmp_big.moveTo(0, (rectHeight));
    	  	tmp_big.lineTo(0, (-(rectHeight)));
    	  	tmp_big._x = (Stage.width-1280)+ 640; // Just trying to put the shape in a certain position
    		tmp_big._y = Stage.height/2;  // Change registration point
    The width is perfect when i draw the line but the height is 3 times 37. What am i doing wrong?

  • #2
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    I think it has to do with your .lineTo.

    What if
    Code:
    	  	tmp_big.moveTo(0, (rectHeight / 2));
    	  	tmp_big.lineTo(0, (-(rectHeight / 2)));
    Other wise your line is going 37 px above the origin and also 37 below I think.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •