You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -6,7 +6,7 @@ properties, including `rotation`, `position`, `scale`, `color`, etc.
6
6
7
7
## Creating Sprites
8
8
There are different ways to create Sprites depending upon what you need to
9
-
accomplish. You can create a `Sprite` from a number of graphic formats including:
9
+
accomplish. You can create a `Sprite` from an image with various of graphic formats including:
10
10
PNG, JPEG, TIFF, and others. Let's go through some create methods and talk about
11
11
each one.
12
12
@@ -18,13 +18,13 @@ auto mySprite = Sprite::create("mysprite.png");
18
18
19
19

20
20
21
-
This creates a `Sprite` using the 'mysprite.png' image. The result is that the
21
+
The statement above creates a `Sprite` using the 'mysprite.png' image. The result is that the
22
22
created `Sprite` uses the whole image. `Sprite` has the same dimensions
23
23
of `mysprite.png`. If the image file is 200 x 200 the resulting `Sprite` is 200 x 200.
24
24
25
25
### Creating a Sprite with a Rect
26
26
27
-
In the previous example, the created `Sprite` has the same size as the original PNG.
27
+
In the previous example, the created `Sprite` has the same size as the original image file.
28
28
If you want to create a `Sprite` with only a certain portion of the image file,
29
29
you can do it by specifying a `Rect`.
30
30
@@ -37,13 +37,12 @@ auto mySprite = Sprite::create("mysprite.png", Rect(0,0,40,40));
37
37

38
38
39
39
`Rect` starts at the top left corner. This is the opposite of what you might be
40
-
used to when laying out screen position as this starts in the lower left corner.
41
-
Thus the resulting `Sprite` is only a portion of the PNG. In this case the `Sprite`
40
+
used to when laying out screen position as it starts from the lower left corner.
41
+
Thus the resulting `Sprite` is only a portion of the image file. In this case the `Sprite`dimension
42
42
is 40 x 40 starting at the top left corner.
43
43
44
-
If you dont specify a `Rect` cocos2d-x does this automatically for the full width
45
-
and height of the image file you specify. To cement another example, if we use a
46
-
PNG that is 200 x 200 the following 2 statements would have the same result.
44
+
If you don't specify a `Rect`, cocos2d-x will automatically using the full width and height of the image file you specify. Take a look at example below, if we use an
45
+
image with dimension 200 x 200 the following 2 statements would have the same result.
47
46
```cpp
48
47
auto mySprite = Sprite::create("mysprite.png");
49
48
@@ -87,7 +86,7 @@ Load your _sprite sheet_ into the `SpriteFrameCache`, probably in `AppDelegate`:
87
86
// load the Sprite Sheet
88
87
auto spritecache = SpriteFrameCache::getInstance();
89
88
90
-
// the .pist file can be generated with any of the tools mentioned below
89
+
// the .plist file can be generated with any of the tools mentioned below
0 commit comments