Image vs Lines? Can I recolor

Hey Guys, just getting into Corona, and so far I’m loving it, I’ve been fighting with appcelerator, and its like day and night! I love This!!

Anyway, I’m in early planning stages of an app I want to make and I wanted to get your guys opinion on which is a better way to make a grid.

So far I am strongly leaning towards dynamically drawing my grid with lines, what makes me pause and consider using an image instead is that my grid is going to have, like, 800 lines. And an image will prolly use much less resources.

The Reason I’m wanting to use lines instead of an image is because I want to be able to dynamically set the stroke color.

So I guess my main question here, is: Is it possible to recolor an image? As in if I make my grid image white on a transparent background and then set the fill color of an image?

I tried myDyamicImage:setFillColor(255,0,0) but it didn’t work (not that I expected it to :slight_smile:
Thanks in Advance
Gypsy

[import]uid: 66287 topic_id: 10895 reply_id: 310895[/import]

You cannot recolor an image - there are plans to allow for this but not yet

c. [import]uid: 24 topic_id: 10895 reply_id: 39653[/import]

I would say rather use an image, and by that i mean an image of just one line and use it over and over it should reuse the same texture memory, as for changing the color im sure you could afford to have different color line images and just swap them around. [import]uid: 45160 topic_id: 10895 reply_id: 39713[/import]

Thanks for your responses,

I decided I’m going to go the full image route, my idea on recoloring it was to have different themes for my app. But I’ll go ahead and make it not quite so low level, I’ll just package it with 3 or 4 image based templates with a small text file that contains font color/style data.
reach, that could be a really good idea, but I wonder how the performance difference would be between drawing vector lines and drawing a collection of image lines. My guess would be that it would be about the same on active memory, but add a little to storage memory requirements. Either way, both ways would require the same heavy drawing loop. [import]uid: 66287 topic_id: 10895 reply_id: 39745[/import]

Why not create a tranparent png with your laid out as the alpha, then use a rectangle vector backround in corona behind it, and then change the colour of the rectangle? Voila any coloured grid…

If you need to change the grid background and the grid lines, then create a mask from a png image, and use 2 vector rectangles (one for the bacground grid colour, and one for the grid line colour… [import]uid: 43961 topic_id: 10895 reply_id: 39747[/import]

oooo thats awesome! Bitmap Mask’s is exactly what I was looking for!!!

Thank you! [import]uid: 66287 topic_id: 10895 reply_id: 39750[/import]

hi gypsy (he’s a friend I introduced to corona)

I was about to throw out a suggestion, but other people already gave you some great answers. [import]uid: 12108 topic_id: 10895 reply_id: 39786[/import]