Is there a way to display a CCNode's anchor point? This would be very useful for debugging.
相关问题
- How to create anchor href using Html.Helper [dupli
- Getting the Named Anchor using ColdFusion
- Scrolling to an element within a div
- Can I apply offset to continious anchor in jsplumb
- Button for downloading SVG in JavaScript & HTML?
相关文章
- Peer 2 Peer call using PJSIP and PJSUA
- iOS tel: and mailto: links only work with target=“
- How to convert String to Audio (Sound) file in ios
- Cocos2d - apply GLImageProcessing effect to CCSpri
- Game center facebook like
- UItextfield text alignment issue in cocos2D iPhone
- CSS word-wrap: break-word not wrapping a tag unles
- Objective-C++ importing C++ class fails, cassert n
You can access the anchor point of a CCNode with
which is a readonly method. Afterwards, you have several ways of actually marking the spot. You could use
while overriding the draw method or alternatively put up a texture on that point, if you want something fancier.
Not built-in, but you could draw a point or circle at the anchor point location using the anchorPointInPoints property.
Of course, I always recommend not to change the anchorPoint in the first place. The alternative is to add the node to a parent node, offset it from the parent, and then the parent's position acts like the anchorpoint for the child node. The advantage is that methods like boundingBox aren't offset from the node's position (can be an issue for hit detection), and you can rotate the child node around its center point and around its parent.