Perhaps the best use of sprite tools, well, at least I used the best use.
First install Css-sprite, install here is very pit, wait for me to finally say.
The code is as follows:
NPM Install Css-sprite
I use gulp to build the front-end code, so I
(3) Sass and Compass-make sprite images,6.1 how the genie works
// Merge various images into one image and change the position of the background image in different States;
6.2 genie importance
// Compress the image memory;
// Reduce HTTP requests6.2
CSS Sprite is also called CSS sprites or CSS sprites, is a background image of the flattening technology. With CSS Sprite, you can reduce the number of requests on the page and reduce the amount of bytes used by the image, to achieve the goal of
First, we will introduce the concept of texture.
Image ---- texture --- memory --- GPU
During the running process, the game should load all the images to be used into the OpenGL ES texture that the GPU can understand and execute. Note that when the
Sprite Frame Cache Introduction
Spriteframecache mainly serves the texture images of multiple pieces of broken images. This texture in a large map contains a number of small images, directly through the Texturecache reference will be a lot of
Create a project using CompassTo use Compass in a new project, you can open the command line tool and enter the following instructionsCompass Create My-projectIf the My-project directory does not exist, the above command creates a directory called
Cocos2d-x 3.1.1 Study Notes [18] Sprite creation tour, cocos2d-x3.1.1
// Input a string to create an Sprite * Sprite: create (const std: string & filename) {// request a memory block from the system/* std :: when nothro has insufficient memory,
In short, it is an animated image.
Two member variables
1) self. Image = the surface of the image to be displayed
2) self. rect = displays the area of the surface,
Common Methods for setting rect: Self. rect = self. image. get_rect ()
Then set self.
SpriteSprite can be said to be the most important component of the game. It describes the genie in the game and is the most important and most flexible subclass of Node. Sprite is very important. It represents the smallest visible unit in the game,
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.