Note: Graphics 2.0 is now in public beta for all Corona SDK Pro and Enterprise subscribers. Please see Walter’s recent blog piece on the news.


rounded rect with image fill

One of our goals with the new graphics engine is to enable vector graphics in Corona. We’re aiming for Illustrator-level capabilities that are going to give you a new level of expressiveness in app development.

Things get incredibly interesting when you can seamlessly combine vector capabilities and raster imaging features together.

To give you an idea, one thing we’re doing is letting you place images inside vector shapes. To do that we’re adding a new ‘fill’ property to shape objects that lets you easily specify the fill image via a table. Here’s a rounded rectangle with our trusty Fishies background image inside it:

local x,y=display.contentCenterX, display.contentCenterY
local bkgd = display.newRoundedRect( x, y, 160, 160, 20 )
bkgd.fill = { type="image", filename="aquariumbackgroundIPhone.jpg" }
bkgd.strokeWidth = 10
bkgd:setStrokeColor( 255, 255, 0 )
  1. Finally, I just hope it’s not only for standard boxes and such, should at least be for any shape of closed vector shape. And a standard colour fill on these polygon vectors would be appreciated too.

  2. Walter,

    Any updates on the bug-fix focus you blogged about couple weeks ago? We are still struggling with numerous widget bugs and the teasers about Graphics 2.0 are really flying over my head. The only thing I really hope graphics 2.0 will give us is automatic dynamic runtime masking for the widgets. The rest is all fluff to me until key issues with existing Corona SDK functionality are resolved.

    Please get the widget fixes done once and for all. This is all too painful.

    Thank you,
    Kerem

      • Walter,

        Thanks for your kind reply. I read the daily build summaries religiously. As a matter of fact, I go there at least 2 – 3 times a day waiting for my next ‘fix’! :-)

        It would be great if the bug reporting system had a view for us developers to see what is in the queue and what priority has been allocated etc. Not trying to mess with how you do your work but not knowing what will get fixed when is affecting the planning process for many of us. Do you think you might consider opening up the bug reporting queue for registered developer read-only access?

        Thanks & best regards,
        Kerem

  3. Kerem,

    Are there specific problems you run into with the widget framework? Could you please post a thread with them at the widget forum so that i can have a look at the issues? Or did you already submit case reports with them, in which case please start a thread and let’s continue the conversation there…

    Thanks,
    Alex

  4. Chris Leyton says:

    @Wilson – I’m intrigued by what else you need for a Tiled-Map engine that isn’t already here? Have you seen Dyson’s awe-inspiring work on MTE? The finest bit of code I’ve seen from Corona.

  5. Walter, great to hear touch-event-capable irregular-shape hot spots will be available. How many points are allowed to define the perimeter for each custom polygon?

  6. Is there any way you can solidify the naming conventions in the future?
    E.g., setStrokeWidth() and setStrokeColor()

    Or is there a specific reason why you differentiate the two?
    Thanks !

  7. Hi Walter,

    I’ve currently got to re-address my whole approach for graphics usage (texture memory & size of app) for my scrolling game. I’ve posted a question here asking for clarification: http://forums.coronalabs.com/topic/37209-help-re-reducing-texture-memory-usage-in-horizontal-scrolling-game-image-sizes-off-screen-culling-etc/

    Q1 – Will the new Vector Graphics version potentially affect my whole approach? That is, for scrolling games that are say 3-6 screens wide, will we be able define the boundaries for ground/earth (for tunnels) via point and get Corona to put in a nice “pattern” to fill?

    Q2 – Any support for Photoshop to export shapes from here so you can copy/paste it directly into a LUA file?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>