开启cocos2dx 3.0的Console功能
以下内容用于自己知识的备忘,想看详细内容,请参照如下地址。 原英文文地址: http://discuss.cocos2d-x.org/t/cocos3-0-tutorial-console-tutorial/14283?username_filters=Lef 注意点: 1.在windows平台下,连接本地时,IP应该为:127.0.0.11234,即 telne
以下内容用于自己知识的备忘,想看详细内容,请参照如下地址。
原英文文地址:
http://discuss.cocos2d-x.org/t/cocos3-0-tutorial-console-tutorial/14283?username_filters=Lef
注意点:
1.在windows平台下,连接本地时,IP应该为:127.0.0.11234,即 telnet 127.0.0.1 1234; 在Mac平台下,才是telnet 0.0.0.0 1234。这一点,原作者没有写清楚。
2.涉及知识点:
a.Console用途
console为高级配制提供接口,即可以在不需要重新编译代码的情况下,改变游戏中的任何变量,并且查看log和其他有用数据。
b.注意点
注意:如果在真机或其他电脑上运行游戏,应该输入设备本地IP地址,类似于192.168.0.122这样的地址,而不是0.0.0.0。
不容易理解部分翻译:
首先,用类型Console::Command定义变量。(什么是Console::Command?它是含有3个字段的简单结构:第一个是字符串类型的命令名称,第二个是字符串类型的命令描述,第三个是回调函数。)
如何初始化命令?设置命令名称为label,描述为:”Change or print the current label string. Args:[
进一步看回调函数。它是带有两个参数的lambda表达式,首先是文件描述符,用来自定义发送响应;其次是任意的文本,比如输入命令:label test 1 2 3 ,参数等于test 1 2 3.
在命令行,如果只输入label,回调函数会从游戏中发回label的文本作为响应;否则用命令行设置的参数值设置游戏中的label的文本。前者是从游戏中获得信息显示在命令行中,后者是将命令行中输入的信息显示在游戏中。此处的游戏客户端有些像FTP服务器。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



There is a dlss function in NVIDIA. After users turn on dlss, the game frame rate can be greatly improved. Therefore, many friends are asking the editor how to turn on dlss. First, make sure that the graphics card supports dlss and the game supports dlss, then you can enable it in the game. Let’s take a look at the specific tutorials below. Answer: DLSS generally needs to be opened in the game. To enable dlss, you must meet the conditions of the device and game. dlss is the "ray tracing effect", you can enter the game settings. Then go to the "Image or Graphics" settings. Then find "Ray Tracing Lighting" and click to open it. d

Both vivox100s and x100 mobile phones are representative models in vivo's mobile phone product line. They respectively represent vivo's high-end technology level in different time periods. Therefore, the two mobile phones have certain differences in design, performance and functions. This article will conduct a detailed comparison between these two mobile phones in terms of performance comparison and function analysis to help consumers better choose the mobile phone that suits them. First, let’s look at the performance comparison between vivox100s and x100. vivox100s is equipped with the latest

Nintendo has opened pre-orders for the latest version of the Switch Lite (curr. $189.99 on Amazon). However, the device is not available to order globally just yet. To recap, the company presented the Switch Lite Hyrule Edition almost two weeks ago d

With the rapid development of the Internet, the concept of self-media has become deeply rooted in people's hearts. So, what exactly is self-media? What are its main features and functions? Next, we will explore these issues one by one. 1. What exactly is self-media? We-media, as the name suggests, means you are the media. It refers to an information carrier through which individuals or teams can independently create, edit, publish and disseminate content through the Internet platform. Different from traditional media, such as newspapers, television, radio, etc., self-media is more interactive and personalized, allowing everyone to become a producer and disseminator of information. 2. What are the main features and functions of self-media? 1. Low threshold: The rise of self-media has lowered the threshold for entering the media industry. Cumbersome equipment and professional teams are no longer needed.

As Xiaohongshu becomes popular among young people, more and more people are beginning to use this platform to share various aspects of their experiences and life insights. How to effectively manage multiple Xiaohongshu accounts has become a key issue. In this article, we will discuss some of the features of Xiaohongshu account management software and explore how to better manage your Xiaohongshu account. As social media grows, many people find themselves needing to manage multiple social accounts. This is also a challenge for Xiaohongshu users. Some Xiaohongshu account management software can help users manage multiple accounts more easily, including automatic content publishing, scheduled publishing, data analysis and other functions. Through these tools, users can manage their accounts more efficiently and increase their account exposure and attention. In addition, Xiaohongshu account management software has

Nintendo presented plenty of games yesterday during its most recent Nintendo Direct event, an overview of which we have provided separately. Additionally, the company also announced a new version of the Switch Lite (curr. $194.93 on Amazon), possibly

In modern society, mobile phones have become an indispensable tool in people's lives. The functions of smart phones are becoming more and more powerful, meeting various needs of people's daily life, work and entertainment. For some users who need to use multiple WeChat accounts at the same time, it is particularly important to enable the dual WeChat function. This article will teach you how to enable dual WeChat functions on your Huawei phone, allowing you to easily manage multiple WeChat accounts. First of all, the EMUI system that comes with Huawei mobile phones already supports dual WeChat functions at the system level, so you only need to follow the following steps to set it up.

If you purchased the MagicX XU Mini M recently, this news might come as a surprise. A hardware and software teardown of the newly released handheld console revealed that the advertised RK3562 CPU is, in fact, a lower-specced, older RK3326 processor.
