Study on quick-cocos2d-x loading progress bar

Source: Internet
Author: User

First, run the quick code:

1 -- [Create a slice progress bar] 2 3 -- create a progress action Action (Progress time, final proportion) 4 Local to1 = ccprogressto: Create (1,100) 5 6 -- pass in the Wizard as the progress bar and create progresstimer 7 Local ptimer = ccprogresstmer: Create (ccsprite: Create (s_ppathsister1) 8 ptimer: settype (kccprogresstimertyperadial) -- set ccprogresstprogretype to radial 9 -- ptimer: setreverseprogress (true) -- set to counter-clockwise rotation load (optional, clockwise by default) 10 ptimer: setposition (ccpointmake (100, S. height/2) 11 ptimer: runaction (ccrepeatforever: Create (to1) 12 layer: addchild (ptimer) 13 14 -- [[progress bar for creating a rectangle] 15 local to2 = ccprogressto: Create (2,100) 16 17 local ptimer1 = ccprogresstimer: Create (ccsprite: Create (s_ppathsister1 )) 18 ptimer1: settype (kccprogresstimertypebar) -- set to rectangular progress bar 19 -- set progress bar 20 ptimer1: setmidpoint (ccpointmake (0, 0) from the left )) 21 -- change the y direction of the progress bar to 0 (the y direction does not change) 22 ptimer1: setbarchangerate (ccpointmake (1, 0) 23 ptimer1: setposition (ccpointmake (100, S. height/2) 24 ptimer1: runaction (ccrepeatforever: Create (to2) 25 layer: addchild (ptimer1)

:

&&

You can also use ccscaleto to load the progress bar. But it is not very good in general.

It's easy to use this ccprogresstimer.

For more information, see quick or cocos2dx ~

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.