objective c - "Combining" a CCSprite into a CCLabelTTF -
I have a game store in which the player can buy items I have a I have it now: I was also trying to set PositionInPoints, but whenever I set a status Use a CCNode as a container, such as: It holds a value label on the continuous offset input on the right side of the coin, which also ends the price. Not tested, coded with memory CCLabelTTF The price of an item and a
CCSprite is an image of a coin next to it. Since the price of the item changes because the user receives more items, the label text coin
CCSprite begins to overlap, which is next to the label, I am trying to create it so that the coin
CCSprite is located on the basis of label status. Is it a better way to add CCSprite as a child to CCLabelTTF? Like
CCSprite in
CCLabelTTF
coin icon = [CCSprite spriteWithImageNamed : @ "Coin.png"]; [Coin mark setskel: 0.3]; PriceLabel.string = [NSString stringWithFormat: @ "% .lf", value]; [Price leakback add-build: coin icon];
coin does not appear on the screen anymore, this is the main problem I am using this method. It will work fine without determining the position, but I need a coin located on the left of
priceLabel . And when I try to set a position and run the app, it does not appear on screen. Any ideas?
// CCSPTITA and CCLTTF by default is anchor (.5, .5) /, so make the same height as the coin in the form of coin and this dead-center // is the vertical top float offsetetset of coin = 8F; Float labelwidthpointpoint = 80.f; CCND * PriceNode = [CCNode Node]; Coin Icon = [CCS Prakash Spit with Image Nominated: @ "Coin Pages"]; [Coin Icon Setszk: 0.3]; PriceLabel.string = [NSString stringWithFormat: @ "% .lf", value]; priceLabel.horizontalAlignment = CctextAlignmentLeft; PriceLabel.dimensions = CGSizeMake (labelWidthInPoints, coinIcon.contentSizeInPoints.height); [Add value node child: coin icon]; [Add value child: price label]; PriceLabel.positionInPoints = ccpid (coin icon positionInPoints, CCIcon.contentSizeInPoints.width + offsetInPoints, coinIcon.position.y));
Comments
Post a Comment