batch fixing ](/microbit/ -> ](/ links
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
|
||||
The width function.
|
||||
|
||||
Get the width of an [Image](/microbit/reference/image/image) in columns.
|
||||
Get the width of an [Image](/reference/image/image) in columns.
|
||||
|
||||
### KindScript
|
||||
|
||||
@ -16,7 +16,7 @@ export function width(_this: micro_bit.Image) : number
|
||||
|
||||
### Returns
|
||||
|
||||
* [Number](/microbit/reference/types/number) - the number of columns in a image. This function returns 5 if the image has 1 frame, 10 for 2 frames, 15 for 3 frames and so on. Divide the number of columns by 5 to find out how many frames an image has (see example below).
|
||||
* [Number](/reference/types/number) - the number of columns in a image. This function returns 5 if the image has 1 frame, 10 for 2 frames, 15 for 3 frames and so on. Divide the number of columns by 5 to find out how many frames an image has (see example below).
|
||||
|
||||
The following example gets the width of `img` and stores it in the `w` variable:
|
||||
|
||||
@ -40,7 +40,7 @@ let w = img.width()
|
||||
|
||||
### Example: show each frame
|
||||
|
||||
The following example uses the `width` function with a [for](/microbit/reference/loops/for) loop to show each image frame on the screen:
|
||||
The following example uses the `width` function with a [for](/reference/loops/for) loop to show each image frame on the screen:
|
||||
|
||||
```
|
||||
let img2 = images.createImage(`
|
||||
@ -58,5 +58,5 @@ for (let i = 0; i < img2.width() / 5; i++) {
|
||||
|
||||
### See also
|
||||
|
||||
[show image](/microbit/reference/images/show-image), [image](/microbit/reference/image/image), [create image](/microbit/reference/images/create-image), [scroll image](/microbit/reference/images/scroll-image), [show animation](/microbit/reference/basic/show-animation)
|
||||
[show image](/reference/images/show-image), [image](/reference/image/image), [create image](/reference/images/create-image), [scroll image](/reference/images/scroll-image), [show animation](/reference/basic/show-animation)
|
||||
|
||||
|
Reference in New Issue
Block a user