Cocos2dx cross-platform engine is really interesting. I recently decided to transfer the game written by oC to cocos2dx.
However, Multi-Resolution on the androd platform is a big problem, which is not called in IOS. 480*320*960*640*1024*768 can be well solved based on pixels.
Fortunately, the setdesignresolutionsize provided on cocos2dx supports multi-resolution, but you will know after using it. If the screen ratio is not
the Two-plane mode, that is, Y and UV are divided into two plane, but UV (cbcr) is a staggered storage, instead of being divided into three plane. The extraction method is similar to the previous one, that is, y '00, y '01, y '10, and y '11 share cr00 and cb00.
3. Format analysis and conversion
Yuv420 planar data, taking the 720x488 Size Image yuv420 planar as an example, the storage format is: the total size is (720x480X3> 1) bytes, divided into three parts: y, U, and Vy: (720x480) bytes
U (C
. Screen density: the number of display points per inch. The screen density is different from the resolution.Android has the following screens:
ScreenTyep
WidthPixels
HeightPixels
DimensionsRange (inches)
Screen Density
QVGA
240
320
2.6-3.0
Low
WQVGA
240
400
3.2-3.5
Low
FWQVGA
240
432
3.5-3.8
Low
HVGA
320
480
3.0-3.5
Medium
WVGA
Cocos2d-x 3.2-2048-Article 1
* *********************************** Please specify the source: bytes ******************************************
2048 this game has been around for a while and has always wanted to be a game.
However, the cocos2d-x engine is learning, and there are other things busy, until now.
Okay, I have to do it now ~.~
This is the first article, which mainly describes:
-- Screen Adaptation
-- Main Interface layout and design
In the preface, I have already shown 2048,
The co
($source)) {case Imagetype_jpeg:imagejpeg ($target _img, $target); Break Case Imagetype_png:imagepng ($target _img, $target); Break Case Imagetype_gif:imagegif ($target _img, $target); Break }//return Boolval (file_exists ($target))//php5.5 the Boolval () function is used to get the returned Boolean value return File_exists ($target)? true:false;// Compatible with low-version PHP notation}
The ================== function uses the way ====================//the original picture
, $resize _h); /* Save the picture to file */if (!file_exists (DirName ($target))) mkdir (DirName ($target), 0777, true); Switch (Exif_imagetype ($source)) {case Imagetype_jpeg:imagejpeg ($target _img, $target); Break Case Imagetype_png:imagepng ($target _img, $target); Break Case Imagetype_gif:imagegif ($target _img, $target); Break }//return Boolval (file_exists ($target))//php5.5 the Boolval () function is used to get the returned Boolean value return File_exists ($targ
If you want to adapt to the same application on different phone models, if you do not use px for all dp in xml, there is still a possibility of adaptation problems!There are countless mistakes and I think I am using dp. Why does the proportion on mobile phone A look different from that on mobile phone B, why is it displayed on mobile phone A while on mobile phone B on the screen?Every explanation is very tiring, so I wrote this blog
First, clarify several conceptsThe density value indicates the
(@ "%@", date);4 //time can be converted to a string5 //You can also convert a string to a time6 //2014-05-317 //2014/05/318 //05/31/20149NSDateFormatter *formatter =[[NSDateFormatter alloc] init];Ten //HH stands for 24 hours hh for 12 hours OneFormatter.dateformat =@"hh:mm"; ANSString *time =[Formatter stringfromdate:date]; - -NSLog (@"Time =%@", time); theMessage.time = time;4. Monitor keyboard notification settings keyboard and view change location1 [[Nsnotificat
DENSITY_DEFAULT: The default value is 160.
4. Screen density: the number of display points per inch. The screen density is different from the resolution.
Android has the following screens:
ScreenTyep
WidthPixels
HeightPixels
DimensionsRange (inches)
Screen Density
QVGA
240
320
2.6-3.0
Low
WQVGA
240
400
3.2-3.5
Low
FWQVGA
240
432
3.5-3.8
Low
HVGA
320
480
density/160 * pixel value. It can be seen that 1px = 1dip on a device with dpi (pixel density) of 160dpi
Sp (ScaledPixels pixel amplification)
It is mainly used for font display (best for textsize ). According to google's suggestion, it is best to use sp as the unit for the font size of TextView, and check the source code of TextView. Android uses sp as the font size unit by default.
Screen
Density
Dpi
Resolution
Matching Group
QVGA
Density
" common# Generate an access log file every day# CustomLog "| bin/rotatelogs.exe-l logs/access-% Y-% m-% d. log 86400 Prime; commonRefer:Solutions for access. log and error. log files under ApacheTwo log files under Apache2 are very large, and the total size is MB.They are access. log and error. log.I found access. log and error. log methods to lose weight on the internet. This method allows the two files to be generated on a daily basis. In this way, you can delete the old file.In th
Mind Mapping Analysis HTTP front-end composition
Full text Overview
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/97/C5/wKiom1kyrIHymsCgAAA4_iqc_LI169.png "title=" Image 1-top.png "width=" 480 "height=" 421 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:480px;height:421px; "alt=" Wkiom1kyrihymscgaaa4_iqc_li169.png "/>This article is divided into three parts: a front-end composition, an HTTP protocol, an HTTP server appl
For different Apple devices, see IOS: Model parameters, SDK, Xcode versions for each of the parameters.model ChangesCoordinates: Indicates the physical size of the screen, the coordinates become larger, indicating that the machine screen size has become larger;Pixels: Indicates the size of the screen picture, with a correspondence between coordinates, such as 1:1 or 1:2, etc.;PPI: A scale value representing the physical size of the screen to the size of the picture, and the scale of the coordina
, using @mipmap/res_id in our resources, and using r.mipmap.res_id in our code. For example, in Androidmanifest.xml, this refers to the Ic_launcher icon:applicationandroid:allowbackup="true"android:icon="@mipmap/ic_ Launcher "android:label=" @string/app_name "android:supportsrtl=" true " android:theme="@style/apptheme"> activity android:name=". Mainactivity "> intent-filter> action android:name="Android.intent.action.MAIN"/> category android:na
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.