Cocos2d-x tutorial (26)-Cocos2d-x + Lua script for large map Scaling

Source: Internet
Author: User

Welcome to Cocos2d-x chat group: 193411763

Video tutorial address: http://www.tudou.com/programs/view/qRiOfppMghM/

Reprinted please indicate the original source: http://blog.csdn.net/u012945598/article/details/24188259


This article uses the Cocos2d-x + Lua script to scale a map.

We usually use scrollView to implement large maps in the game. Here we still use CCScrollView for demonstration.

Create a Lua-based project. The following code is directly completed in hello. lua and hello2.lua.

Code in hello. lua:


In hello. lua, we create a scenario and call the createWorldMapLayer method in hello2.lua to pass in the scenario as a parameter.

Hello2.lua File




Comparison of effects before and after scaling:



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.