Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(natives/five): SET_RUNTIME_TEXTURE_IMAGE command
Another end user request: https://forum.cfx.re/t/5015014
- Loading branch information
1 parent
0485939
commit cbfe089
Showing
2 changed files
with
186 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
ns: CFX | ||
apiset: client | ||
--- | ||
## SET_RUNTIME_TEXTURE_IMAGE | ||
|
||
```c | ||
BOOL SET_RUNTIME_TEXTURE_IMAGE(long tex, char* fileName); | ||
``` | ||
Replaces the pixel data in a runtime texture with the image data from a file in the current resource, or a data URL. | ||
If the bitmap is a different size compared to the existing texture, it will be resampled. | ||
This command may end up executed asynchronously, and only update the texture data at a later time. | ||
## Parameters | ||
* **tex**: A runtime texture handle. | ||
* **fileName**: The file name of an image to load, or a base64 "data:" URL. This should preferably be a PNG, and has to be specified as a `file` in the resource manifest. | ||
## Return value | ||
TRUE for success, FALSE for failure. |