I have been trying to use cgsizemake
as follows:
I'm trying to make the frame of my image a different size using cgrectmake
instead of changing the coordinates.
So far I have tried
maincharacter.frame = cgsizemake (14, 14);
but I keep getting the error
assigning to cgrect from incompatible type CGsize
One solution would be:
CGRect frame = maincharacter.frame;
frame.size = CGSizeMake(14, 14);
maincharacter.frame = frame;
CGSize only accepts height and width
CGSize c=CGSizeMake(width, height);
If you want to set the frame size use CGRectMake
maincharacter.frame=CGRectMake(x-origin,y-origin, width, height);
maincharacter.frame must return (x, y, width, height) 4 parameters and CGSizeMake only have "width" and "height" 2 parameters. So You got an error. The solution is use frame.size, which returns 2 parameters to work with CGSizeMake(14, 14).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With