Skip to content

Commit

Permalink
Adds some extra pages for new global functions
Browse files Browse the repository at this point in the history
  • Loading branch information
JujuAdams committed Sep 5, 2024
1 parent cb3a9a9 commit 55e99b4
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/22.0/BulbDrawLitApplicationSurface.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# BulbDrawLitApplicationSurface

 

`BulbDrawLitApplicationSurface(renderer, [x], [y], [width], [height], [textureFiltering], [alphaBlend=false])`

**Returns:** N/A (`undefined`)

|Argument |Datatype|Purpose |
|--------------------|--------|---------------------------------------------------------------------------------------------------------------------------------------|
|`renderer` |renderer|Renderer to use to draw the application surface |
|`[x]` |number |x position to draw the application surface at. If not specified, the position returned by `application_get_position()` will be used |
|`[y]` |number |y position to draw the application surface at. If not specified, the position returned by `application_get_position()` will be used |
|`[width]` |number |width to draw the application surface. If not specified, the width returned by `application_get_position()` will be used |
|`[height]` |number |heighr to draw the application surface. If not specified, the height returned by `application_get_position()` will be used |
|`[textureFiltering]`|boolean |Whether to use texture filtering when drawing the application surface. If not specified, the texture filter setting will not be changed|
|`[alphaBlend]` |boolean |Whether to use texture filtering when drawing the application surface. If not specified, alpha blending will be disabled |
100 changes: 100 additions & 0 deletions docs/22.0/NormalMapFunctions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# Normal Map Functions

 

## BulbNormalMapClear

`BulbNormalMapClear()`

**Returns:** N/A (`undefined`)

|Argument|Datatype|Purpose|
|--------|--------|-------|
|None | | |

Clears a normal map surface, resetting all pixels to "flat" i.e. the normal for that pixel will be set to `(0,0,1)`, a vector that points straight upwards.

 

## BulbNormalMapShaderSet

`BulbNormalMapShaderSet([forceFlat=false])`

**Returns:** N/A (`undefined`)

|Argument |Datatype|Purpose |
|-------------|--------|------------------------------------------------------------------------------------|
|`[forceFlat]`|boolean |Whether subsequent draw calls should be forced to draw "flat" data to the normal map|

Before drawing normal map graphics to a renderer's normal map surface using Bulb's native functions (see below) you must call this function. If the `forceFlat` parameter is set to `true` then all draw calls will be forced to "flat" i.e. the normal will be set to `(0,0,1)`, a vector that points straight upwards.

 

## BulbNormalMapShaderReset

`BulbNormalMapShaderReset()`

**Returns:** N/A (`undefined`)

|Argument|Datatype|Purpose|
|--------|--------|-------|
|None | | |

Resets ("un-sets") the Bulb normal map shader.

 

## BulbNormalMapDrawSelf

`BulbNormalMapDrawSelf([spriteIndex])`

**Returns:** N/A (`undefined`)

|Argument |Datatype |Purpose |
|---------------|------------|----------------------------------------------------------------------------------------|
|`[spriteIndex]`|sprite index|Sprite to draw. If not specified, the instance's current sprite (`sprite_index`) is used|

Analogous to GameMaker's native `draw_self()` function.

?> You should set Bulb's normal map shader before executing this function by calling `BulbNormalMapShaderSet()` beforehand.

 

## BulbNormalMapDrawSprite

`BulbNormalMapDrawSprite(sprite, image, x, y)`

**Returns:** N/A (`undefined`)

|Argument|Datatype |Purpose |
|--------|------------|--------------------------------|
|`sprite`|sprite index|Sprite to draw |
|`image` |number |Image of the sprite to draw |
|`x` |number |x position to draw the sprite at|
|`y` |number |y position to draw the sprite at|

Analogous to GameMaker's native `draw_sprite()` function.

?> You should set Bulb's normal map shader before executing this function by calling `BulbNormalMapShaderSet()` beforehand.

 

## BulbNormalMapDrawSpriteExt

`BulbNormalMapDrawSpriteExt(sprite, image, x, y, xScale, yScale, angle)`

**Returns:** N/A (`undefined`)

|Argument|Datatype |Purpose |
|--------|------------|--------------------------------------|
|`sprite`|sprite index|Sprite to draw |
|`image` |number |Image of the sprite to draw |
|`x` |number |x position to draw the sprite at |
|`y` |number |y position to draw the sprite at |
|`xScale`|number |x scale to use when drawing the sprite|
|`yScale`|number |y scale to use when drawing the sprite|
|`angle` |number |Rotation of the sprite in degrees |

Analogous to GameMaker's native `draw_sprite_ext()` function.

?> You should set Bulb's normal map shader before executing this function by calling `BulbNormalMapShaderSet()` beforehand.
2 changes: 2 additions & 0 deletions docs/22.0/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
- [BulbAmbienceSprite](BulbAmbienceSprite)
- [BulbShadowOverlay](BulbShadowOverlay)
- [BulbLightOverlay](BulbLightOverlay)
- [BulbDrawLitApplicationSurface](BulbDrawLitApplicationSurface)
- [Normal Map Functions](NormalMapFunctions)

0 comments on commit 55e99b4

Please sign in to comment.