Jump to content

Draw texture on Lines2D


Knight
 Share

Recommended Posts

Hi and welcome to the forum and apologies that it has taken so long to get a reply, and one that will not be all that helpful sorry to say. Lines2D is part of Canvas2D which I not very familiar with however the documentation states that Lines2D inherits from Shape2D which uses a Brush for its fill and only uses a solid color or a gradient color, so unless a Canvas2D expert says otherwise I would say no textures.

There is an alternative, using a tube to draw the line

Check the PG that goes with the above post.

Link to comment
Share on other sites

Hi guys.

I was thinking of one other way. Use a standard BJS plane (.isPickable = false), parented to camera (in a way where plane area == renderCanvas area)... then apply empty BJS dynamicTexture onto plane.  (Like a piece of clear glass... placed precisely atop the renderCanvas. Similar to a ScreenSpaceCanvas2D, but not one.)  :)

Then use .getContext() to get the context2d of that dynamicTexture, and start making "strokes" on it.  :o  Remember to update your dynamicTexture after each change.

https://www.w3.org/TR/2014/CR-2dcontext-20140821/#fill-and-stroke-styles

"Pattern" is a type of fill, there.

pattern = context.createPattern(image, repetition)

"image".  Yay!  Could be possible.  Wear your hard hat... things might blow up.  :)  (probably won't)

Some crazy playground-maker was doing something weird... here.  Looks pretty fancy.  I found that PG ... while I was searching-for a simple playground that showed .update()... like this playground... line 32.  Party on, guys.

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...