Jump to content

Drawing 1 px lines


JohnMo
 Share

Recommended Posts

Hello,

Im trying to draw 1 px lines, but Im having some problems with them..

The drawn lines are not 1 px, but 2 or 3. 

Some times they appear correct (1 px), but sometimes they change 

The main container is scaled, but I dont  think this could be the problem.

this is how i see it

image.thumb.png.e92c06e25c48a2393a620f6ae7250ea3.png

this is my code.. 

Application options:

autoDensity: true,
width: WIDTH,
height: HEIGHT,
antialias: true,
backgroundAlpha: 0,
resolution: window.devicePixelRatio,
sharedLoader: true,

Lines:

const horizontalGraphic = new Graphics()
horizontalGraphic.lineStyle(1, 0x333333, 1)
horizontalGraphic.moveTo(1, 1)
horizontalGraphic.lineTo(w + 1, 1)
horizontalGraphic.position.set(0, w)
const s1 = new Sprite(renderer.generateTexture(horizontalGraphic))
s1.addChild(horizontalGraphic)
outlineRectangle.addChild(s1)
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...