cocos2dx關於size的知識

2021-07-04 14:00:16 字數 1901 閱讀 5762

framesize:是實際的螢幕解析度

winsize:邏輯上的遊戲解析度。開發者設計的

visiblesize:是在 winsize 之內,保持 framesize 的寬高比所能占用的最大區域

// 組

[1] :

2.  framesize:            width = 720, height = 420 

3.  winsize:          width = 720, height = 480 

4.  visiblesize:      width = 720, height = 420 

5.  visibleorigin:        x = 0, y = 30 

6. 

7. 

// 組

[2] :相比組

[1] framesize 

不變visiblesize 

和visibleorigin 

隨著winsize 

的變小而變小

8.  framesize:            width = 720, height = 420 

9.  winsize:          width = 480, height = 320 

10. visiblesize:      width = 480, height = 280 

11. visibleorigin:        x = 0, y = 20 

12.

13.

// 組

[3] : 

相比組[1] winsize 

不變,visiblesize 

隨著framesize 

的比例改變而改變

14. framesize:            width = 720, height = 540 

15. winsize:          width = 720, height = 480 

16. visiblesize:      width = 640, height = 480 

17. visibleorigin:        x = 40, y = 0 

18.

19.

// winsize visiblesize visibleorigin 

與都設計的解析度相關,滿足如下關係

20. winsize.width = (visibleorigin.x * 2) + visiblesize.width 

21. winsize.height = (visibleorigin.y * 2) + visiblesize.height 

螢幕顯示的幾種模式

noborder 為了消去黑邊。對拉伸至填滿黑邊。造成另一邊的超出螢幕

showall 有黑邊。具體怎麼變不甚了解

kresolutionunknown

:預設的,自動取了手機螢幕大小;

kresolutionexactfit

:拉伸全屏

kresolutionnoborder

:手機全屏顯示,但是可能有內容顯示在螢幕外頭;

kresolutionfixedheight

:保持高度,寬度剪裁

kresolutionfixedwidth

:保持寬度,高度剪裁

kresolutionshowall

:顯示所有內容,但是可能有黑邊,設計的時候使用絕對值;

關於cocos2dx中tableView的一些理解

先看 h檔案中 ifndef helloworld scene h define helloworld scene h include cocos2d.h include cocos ext.h using ns cc using ns cc ext class helloworld public ...

cocos2dx筆記 關於action

1.基本動作instantaction 放置 place 隱藏 hide 顯示 show 可見切換 togglevisibility 2.延時動作 移動到 ccmoveto 移動 ccmoveby 跳躍到 ccjumpto 跳躍 ccjumpby 貝塞爾 ccbezierby 放大到 ccscale...

關於學習cocos2d x的計畫

學習cocos2d x才一段時間,對cocos2d x基本概念,以及它開發遊戲的過程基本上有了個總體的把握。由於自己用在win32下用gdi寫過小遊戲,加上看過一些關於遊戲程式設計的書籍,所以對遊戲方面有相應的了解。因此看起cocos2d x的書籍基本上都能很快理解。但是同時,由於看得過快,總是很多...