); // content to be displayed, Font, font size // here you can also use the following method to change the content to be displayed: pLabel-> setString ("NEUQ"); pLabel-> setPosition (ccp (100,100 )); this-> addChild (pLabel, 1 );
2. CCLabelAtlas
CCLabelBMFont is suitable for text content that needs to be updated frequently or for displaying beautiful and gorgeous text content. CCLabelBMFont is used to display text content in an image file, which is eq
The cocos2d-x provides a variety of menu items, including: CCMenuItemLable, CCMenuItemSprite, temperature, temperature, and CCMenuItemImage. They all inherit CCMenuItem, the inheritance diagram is as follows: CCMenuItemLable: mainly including labels and labels. Usage: [cpp] usage: setFontName ("Marker Felt"); CCMenuItemFont: setFontSize (34); usage * pCloseItemFont = CCMenuItemFont: create ("CloseFont", this, menu_selector (HelloWorld: menuCloseCallback); pCloseItemFont-> setPosition (
section.It is very easy to use ppp to connect to PPPoE. After FreeBSD is installed, you will go to the/etc/ppp/directory.The following shows a file named ppp. conf. You can change this file to the following file to connect to it.PPPoE: The file content is as follows: default:Set log Phase Chat lcp ipcp ccp tun commandIdent user-ppp VERSION (built COMPILATIONDATE)
# Ensure that "device" references the correct serial port# For your modem. (cuaa0 = COM
Do program development must take into account the memory optimization, after all, the iphone itself is not very large memory, this section mainly said that the cocos2d development of memory optimization, specific performance in, both the same sprite (image) can only render once, or can not be rendered only once.The following is the procedure of the program, first block the previous code.let's start with a brief introductionCcspritebatchnode optimize game rendering efficiency, in the >ccspriteb
angle to radians float Radian = angle*3.14159/180.0;//The first control point is the midpoint of the parabolic left half arc float q1x = startpoint.x+ (end point.x-startpoint.x)/4.0; Ccpoint q1 = CCP (q1x, Height + startpoint.y+cos (radian) *q1x);//The second control point is the midpoint of the entire parabola float q2x = startpoint.x + (endpoint.x-st Artpoint.x)/2.0; Ccpoint q2 = CCP (q2x, Height + start
of Bg1.
To know the coordinates of the SP element on the screen, you need to know the coordinates of Bg1 on the screen and the coordinates of SP relative to Bg1.
Because the setposition set by SP isCoordinates relative to the parent node Bg1, not the actual coordinates on the screen.
/// 1. obtain the coordinates of the map layer. P1 is the coordinate ccpoint p1 = gamemap-> getposition (); // 2. obtain the SP coordinate. PSP is the coordinate ccpoint PSP = (gamemap-> SP)-> getposition (); // 3.
For example, "our motherland is a garden" is transformed into "wmdzgshy"
Ansistring chinesetopy (ansistring Chinese){Ansistring tchinese, result = "";Tchinese = trim (Chinese );Ansistring temp = "";Char * CCP = new char [Chinese. Length () + 1];Strcpy (CCP, tchinese. c_str ());For (INT I = 0; I {If (Word (CCP [I]) Temp = temp +
enable compression
Set ccp yes mppc
Set ccp yes mpp-e40
Set ccp yes mpp-e128
Set bundle enable crypt-reqd
Set ccp yes mpp-stateless
Open
The configuration of/usr/local/etc/mpd. links is as follows:
Vpn:
Set link type pptp
Set pptp self 192.168.0.1
# Set pptp peer 2.3.4.5
Set pptp enable originate incoming outcall
(! PCloseItem );// Place the menu item bottom-right conner.PCloseItem-> setPosition (ccp (CCDirector: shareddire()-> getWinSize (). width-20, 20 ));// Create a menu with the "close" menu item, it's an auto release object.CCMenu * pMenu = CCMenu: menuWithItems (pCloseItem, NULL );PMenu-> setPosition (CCPointZero );CC_BREAK_IF (! PMenu );// Add the menu to HelloWorld layer as a child layer.This-> addChild (pMenu, 1 );// Get window size and place the la
Original article, reproduced please indicate the source: http://blog.csdn.net/zhy_cheng/article/details/9736973
Cocos2d-x implements Chinese, there are two ways to transcode and read XML files, For the first, in my blog
[Cocos2d-x game engine development notes (2)] rendering text on the screen has an introduction, next to see how to read Chinese from XML files.
The content with source code XML in testcpp is organized as follows:
In this way, each Chinese field has a key, which can be used to o
: createwithspriteframe (ccspriteframecache: equals () -> spriteframebyname ("guide_connecting_ttf"); sp_connecting-> setanchorpoin T (CCP (0, 1); sp_connecting-> setposition (CCP (1640,175 0); sp_connecting-> setscale (1.5f); this-> addchild (sp_connecting ); // If the wlanstate is equal to 1 at the beginning of a certain time point, a sp_connecting genie will be created for each frame starting from this f
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.