iOS Question coloring the custom shapes

tufanv

Expert
Licensed User
Longtime User
Hello,

In b4i i want to do something but i need advise on how to do it: Picture is below :



2ynqzol.jpg



I want to create shapes like this : For example in this photo there are circle and some squares. First of all can i create shapes like this. I cant use an image because later i want to fill some sections with different colors. For example i will have to color section 5. I need an idea on how to proceed on this .

Thank you
 

ilan

Expert
Licensed User
Longtime User
Upvote 0

tufanv

Expert
Licensed User
Longtime User
Using images will not be good because i need to color each piece programatically. So it is not possible. With objective c I dont think i will be able to do it :/ .
you can use canvas... with canvas you can draw circle, rect,...

you can also draw a path but not like in your photo, if the shapes must look like in your photo, in b4i your only choice that i know is use images or you will need to use a nativobject, see this: https://developer.apple.com/library...awingPrintingiOS/BezierPaths/BezierPaths.html
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
why you cannot do it with images? just put 2 images of each part with 2 colors like white and red then if press or any other event then change only image of the piece you want to change.

i did a small project for you that use a timer to change each piece, take a look at it...

(file is to large to upload it here so download it from my site) www.sagital.net/shapes.zip
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
why you cannot do it with images? just put 2 images of each part with 2 colors like white and red then if press or any other event then change only image of the piece you want to change.

i did a small project for you that use a timer to change each piece, take a look at it...

(file is to large to upload it here so download it from my site) www.sagital.net/shapes.zip

I am planning it as a part of the game that will have about 100 levels. So for each level i need many pictures:/ for that , i think i cant work with images.
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
why you cannot do it with images? just put 2 images of each part with 2 colors like white and red then if press or any other event then change only image of the piece you want to change.

i did a small project for you that use a timer to change each piece, take a look at it...

(file is to large to upload it here so download it from my site) www.sagital.net/shapes.zip

I am now checking your example it seems very interesting but as i said because of the amount of different pics , it is a problem i think
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
I am now checking your example it seems very interesting but as i said because of the amount of different pics , it is a problem i think

it doesnot matter how many levels you have, what is importent is how many shapes you will need. if its about 10 shapes like in your example photo and about 5 different colors per shape then we are talking only about 50 images, with the right coding it will be very simple.

the second choice is to draw path and use canvas, but b4i supports only circle, rect, rect with raidius, lines..., no shapes like you have in your photo, maybe you should consider to change the game to simple shapes and then you can use canvas...
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
it doesnot matter how many levels you have, what is importent is how many shapes you will need. if its about 10 shapes like in your example photo and about 5 different colors per shape then we are talking only about 50 images, with the right coding it will be very simple.

the second choice is to draw path and use canvas, but b4i supports only circle, rect, rect with raidius, lines..., no shapes like you have in your photo, maybe you should consider to change the game to simple shapes and then you can use canvas...

Ok Ilan TY for your help. I will think about it and find a solution
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
btw, i didnot use b4i for maybe a month, thanx to you i used b4i and got back the passion for it :)...

working on something big now for b4a but after that b4i get ready to rumble....:D
 
Upvote 0

narek adonts

Well-Known Member
Licensed User
Longtime User
Upvote 0

tufanv

Expert
Licensed User
Longtime User
Attached small project with a layout which shows how to achieve your issue with panels.

corner radius 126. Brilliant ! =) TY it is a good idea i never tought of that.
BTW after creating the path and draw it with canvas , can i fill it with a color each of the shapes with canvas ?
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
btw, i didnot use b4i for maybe a month, thanx to you i used b4i and got back the passion for it :)...

working on something big now for b4a but after that b4i get ready to rumble....:D

Ilan, you should concentrate on b4i . At first i think that appstore was a lot of trouble with reviews etc.. but now i understand that it is much much better than the google play store.
 
Upvote 0

narek adonts

Well-Known Member
Licensed User
Longtime User
Upvote 0
Top