Fill a "Shape" with a Texture?
  • MindJuiceMindJuice December 2011
    Posts: 14

    Does Pixelwave allow you to create a shape using, for example, moveToX:y and lineToX:y and fill that shape with a specific texture?


    If you have seen the terrain in Smuggle Truck and the editor they use to make levels, you'll have an idea what I want to achieve.

    See this video of the editor at about 1:15 in:

       

    In short, I want to create a shape from points in a level file and apply a repeating horizontal texture to that shape.  Then I want to add new geometry on the right side of the shape as it's about to come into view, and remove geometry from the shape on the left side once it is no longer visible.

    Thanks,


    Ken
  • JohnJohn December 2011
    Posts: 52

    Hey Ken,


    I have some good news for you, in our graphics-alpha branch we have really upgraded PXGraphics, it now has almost every feature flash does. It is still in alpha, but feel free to pull it and test it out. What you are looking for is beginFillWithTextureData. There are helper methods on the way, but for now we have only the most verbose. I know you are using particles, so you will need to merge them together, however this should be somewhat painless to do. There will be more information on this when we make the formal announcement. In the mean time, I hope you like it, let us know what you think!

    -John

    Pixelwave Team - Lead Developer
    // Clean before you build, otherwise the dust will get in.
  • MindJuiceMindJuice December 2011
    Posts: 14

    Hi John,


    That is good news!  I was asking for a need a couple of months in the future, so perhaps it will all be mainline by then.

    I just needed to know if it was possible to make a decision on some art assets I am having created. :-)

    As a follow-up question, do you know what technique they might have used to get the rock border texture along the top to integrate and follow the contour of the land so well?

    Any way I have thought of so far would make visible seams at the edges.
  • oztuneoztune January 2
    Posts: 177

    Hey Ken,


    I've never done the curved terrain effect before but I'll guess that the top of the terrain is just a mesh that's curved to fit the contour of the land, and the repeating rock texture is texture mapped to fit it. It's similar to how a ripple effect would be done with a lattice of vertices.
    Pixelwave team
    // Founder
  • MindJuiceMindJuice January 2
    Posts: 14

    Yeah...I am sure it's something like that too, but working with meshes and textures is something I've never done.  Guess I have some research to do!


    Thanks,

    Ken
  • JohnJohn January 3
    Posts: 52

    I quickly put together an example to demonstrate how this could be done. I put the black line under the top terrain to make the breakpoint between the top part and the repeating bottom more apparent.



    Let me know if this helps!

    -John
    Pixelwave Team - Lead Developer
    // Clean before you build, otherwise the dust will get in.
  • MindJuiceMindJuice January 7
    Posts: 14

    Hi John,


    Wow!  Thanks!  That's awesome!

    As I mentioned, it will be a couple of months before we get around to coding the game, but the art is well underway.

    I'll let you know once we have the basic land scrolling working so you can see it in action!




    Ken

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Twitter Sign In with OpenID

Sign In Apply for Membership

In this Discussion

Tagged

Top Posters