In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
What is the anchor point and location in cocos2d-x? I believe many inexperienced people don't know what to do about it. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
There are many novice friends who do not quite understand the difference and relationship between anchor and position, so today I will explain it with my own screenshot.
Anchor points and locations are also useful in coco, because when you want to add pictures to layer, you may add them in different locations according to different needs, so you need to understand the relationship and difference between anchor points and locations.
Now explain the noun: anchor: do not need Baidu's explanation, because it will make you more confused, I will talk about my understanding, anchor can be understood as the meaning of relative point. And I don't have to explain the location.
Now use my screenshot to explain in detail, there is a picture, there is a truth, there is no picture to say jb, is it right?
This picture shows what happens if you want to set position to (20) and you have set anchor (0.5). Have you noticed a problem if you set a position to (0d0) and set anchor to (0.5), you will find that the result is different from what you think, you will only see 1/4 of the picture. I will not draw a picture, it is very simple, we have figured it out.
This picture explains what happens if the anchor (0rem 0) position is (20rem 20). I won't repeat what is said in the screenshot.
In addition, I am attaching a cocos2d-x opengl coordinate system and windows/android comparison.
After reading the above, have you mastered the method of anchor point and location in cocos2d-x? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.