From 8250cd038eb7c567ea904a5dc00851207d9f856a Mon Sep 17 00:00:00 2001 From: Aldrin John Olaer Manalansan <39627255+Aldrin-John-Olaer-Manalansan@users.noreply.github.com> Date: Sun, 2 Mar 2025 23:27:54 +0800 Subject: [PATCH] :memo: update commands --- sa/sa.json | 237 +++++++++++++++++++-------------- sa/snippets/SAMPFUNCS/0B67.txt | 2 +- sa/snippets/SAMPFUNCS/0B6B.txt | 3 + sa/snippets/SAMPFUNCS/0B6C.txt | 3 + sa/snippets/SAMPFUNCS/0B6D.txt | 2 + sa/snippets/SAMPFUNCS/0B6E.txt | 3 + sa/snippets/SAMPFUNCS/0B6F.txt | 2 + sa/snippets/SAMPFUNCS/0B70.txt | 1 + sa/snippets/SAMPFUNCS/0B71.txt | 2 + sa/snippets/SAMPFUNCS/0B72.txt | 3 + sa/snippets/SAMPFUNCS/0B73.txt | 3 + sa/version.txt | 2 +- 12 files changed, 164 insertions(+), 99 deletions(-) create mode 100644 sa/snippets/SAMPFUNCS/0B6B.txt create mode 100644 sa/snippets/SAMPFUNCS/0B6C.txt create mode 100644 sa/snippets/SAMPFUNCS/0B6D.txt create mode 100644 sa/snippets/SAMPFUNCS/0B6E.txt create mode 100644 sa/snippets/SAMPFUNCS/0B6F.txt create mode 100644 sa/snippets/SAMPFUNCS/0B70.txt create mode 100644 sa/snippets/SAMPFUNCS/0B71.txt create mode 100644 sa/snippets/SAMPFUNCS/0B72.txt create mode 100644 sa/snippets/SAMPFUNCS/0B73.txt diff --git a/sa/sa.json b/sa/sa.json index bea18d06..03806ab1 100644 --- a/sa/sa.json +++ b/sa/sa.json @@ -1,7 +1,7 @@ { "meta": { - "last_update": 1740911072455, - "version": "0.870", + "last_update": 1740928903870, + "version": "0.871", "url": "https://library.sannybuilder.com/#/sa" }, "extensions": [ @@ -61437,7 +61437,7 @@ } ], "id": "0B67", - "name": "SAMP_ARGB_TO_HEX", + "name": "SF_ARGB_TO_HEX", "num_params": 5, "short_desc": "mixes color channels into 0xAARRGGBB colorcode format" }, @@ -61538,204 +61538,247 @@ "short_desc": "Draws a rectangular area with border at the specified coordinates" }, { - "id": "0B6B", - "name": "SAMP_RENDER_GET_FONT_DRAW_LENGTH", - "num_params": 3, "input": [ { - "name": "_p1", - "type": "int" + "name": "self", + "type": "RenderFont" }, { - "name": "_p2", - "type": "int" - }, + "name": "text", + "type": "string" + } + ], + "output": [ { - "name": "_p3", - "type": "int" + "name": "width", + "type": "int", + "source": "var_any" } - ] + ], + "id": "0B6B", + "name": "SF_RENDER_GET_DRAW_WIDTH_OF_TEXT_WITH_FONT", + "num_params": 3, + "short_desc": "Returns the width (in pixels) that will be occupied by the text with font", + "class": "RenderFont", + "member": "GetDrawWidth" }, { - "id": "0B6C", - "name": "SAMP_RENDER_GET_FONT_DRAW_HEIGHT", - "num_params": 2, "input": [ { - "name": "_p1", - "type": "int" - }, + "name": "self", + "type": "RenderFont" + } + ], + "output": [ { - "name": "_p2", - "type": "int" + "name": "height", + "type": "int", + "source": "var_any" } - ] + ], + "id": "0B6C", + "name": "SF_RENDER_GET_FONT_DRAW_HEIGHT", + "num_params": 2, + "short_desc": "Returns the height (in pixels) occupied by any text that uses the specified font", + "class": "RenderFont", + "member": "GetDrawHeight" }, { - "id": "0B6D", - "name": "SAMP_RENDER_CREATE_FONT", - "num_params": 4, "input": [ { - "name": "_p1", - "type": "int" + "name": "fontname", + "type": "string" }, { - "name": "_p2", + "name": "size", "type": "int" }, { - "name": "_p3", + "name": "flags", "type": "int" - }, + } + ], + "output": [ { - "name": "_p4", - "type": "int" + "name": "handle", + "type": "RenderFont", + "source": "var_any" } - ] + ], + "id": "0B6D", + "name": "SF_RENDER_CREATE_FONT", + "num_params": 4, + "short_desc": "Creates a RenderFont Object", + "class": "RenderFont", + "member": "Create", + "attrs": { + "is_constructor": true + } }, { + "input": [ + { + "name": "self", + "type": "RenderFont" + } + ], "id": "0B6E", - "name": "SAMP_RENDER_RELEASE_FONT", + "name": "SF_RENDER_DELETE_FONT", "num_params": 1, "attrs": { - "is_condition": true + "is_condition": true, + "is_destructor": true }, - "input": [ - { - "name": "_p1", - "type": "int" - } - ] + "short_desc": "Destroys the specified font object, freeing it from memory", + "class": "RenderFont", + "member": "Delete" }, { - "id": "0B6F", - "name": "SAMP_RENDER_FONT_DRAW_TEXT", - "num_params": 5, "input": [ { - "name": "_p1", - "type": "int" + "name": "self", + "type": "RenderFont" }, { - "name": "_p2", - "type": "int" + "name": "text", + "type": "string" }, { - "name": "_p3", + "name": "coordx", "type": "int" }, { - "name": "_p4", + "name": "coordy", "type": "int" }, { - "name": "_p5", + "name": "color", "type": "int" } - ] + ], + "id": "0B6F", + "name": "SF_RENDER_DRAW_TEXT_WITH_FONT", + "num_params": 5, + "short_desc": "Draws text using the specified font", + "class": "RenderFont", + "member": "DrawText" }, { - "id": "0B70", - "name": "SAMP_RENDER_DRAW_POLYGON", - "num_params": 7, "input": [ { - "name": "_p1", + "name": "coordx", "type": "int" }, { - "name": "_p2", + "name": "coordy", "type": "int" }, { - "name": "_p3", + "name": "width", "type": "int" }, { - "name": "_p4", + "name": "height", "type": "int" }, { - "name": "_p5", + "name": "cornercount", "type": "int" }, { - "name": "_p6", - "type": "int" + "name": "heading", + "type": "float" }, { - "name": "_p7", + "name": "color", "type": "int" } - ] + ], + "id": "0B70", + "name": "SF_RENDER_DRAW_POLYGON", + "num_params": 7, + "short_desc": "Draws a polygon with the specified parameters" }, { + "input": [ + { + "name": "filepath", + "type": "string" + } + ], + "output": [ + { + "name": "handle", + "type": "RenderTexture", + "source": "var_any" + } + ], "id": "0B71", - "name": "SAMP_RENDER_LOAD_TEXTURE_FROM_FILE", + "name": "SF_RENDER_LOAD_TEXTURE_FROM_FILE", "num_params": 2, "attrs": { - "is_condition": true + "is_condition": true, + "is_constructor": true }, + "short_desc": "Loads a file (any image, or txd) as RenderTexture Object", + "class": "RenderTexture", + "member": "Load" + }, + { "input": [ { - "name": "_p1", - "type": "int" - }, - { - "name": "_p2", - "type": "int" + "name": "self", + "type": "RenderTexture" } - ] - }, - { + ], "id": "0B72", - "name": "SAMP_RENDER_RELEASE_TEXTURE", + "name": "SF_RENDER_RELEASE_TEXTURE", "num_params": 1, "attrs": { - "is_condition": true + "is_condition": true, + "is_destructor": true }, - "input": [ - { - "name": "_p1", - "type": "int" - } - ] + "class": "RenderTexture", + "member": "Release", + "short_desc": "Releases the RenderTexture Object, freeing it from memory" }, { - "id": "0B73", - "name": "SAMP_RENDER_DRAW_TEXTURE", - "num_params": 7, "input": [ { - "name": "_p1", - "type": "int" + "name": "self", + "type": "RenderTexture" }, { - "name": "_p2", + "name": "coordx", "type": "int" }, { - "name": "_p3", + "name": "coordy", "type": "int" }, { - "name": "_p4", + "name": "width", "type": "int" }, { - "name": "_p5", + "name": "height", "type": "int" }, { - "name": "_p6", - "type": "int" + "name": "heading", + "type": "float" }, { - "name": "_p7", + "name": "contrast", "type": "int" } - ] + ], + "id": "0B73", + "name": "SF_RENDER_DRAW_TEXTURE", + "num_params": 7, + "class": "RenderTexture", + "member": "Draw", + "short_desc": "Draws the texture on the screen" }, { "id": "0B74", diff --git a/sa/snippets/SAMPFUNCS/0B67.txt b/sa/snippets/SAMPFUNCS/0B67.txt index 22e586d4..ac6177f8 100644 --- a/sa/snippets/SAMPFUNCS/0B67.txt +++ b/sa/snippets/SAMPFUNCS/0B67.txt @@ -1,2 +1,2 @@ -int colorCode = SAMP_ARGB_TO_HEX {alpha} 0xFF {red} 0x5A {green} 0x14 {blue} 0xCA +int colorCode = SF_ARGB_TO_HEX {alpha} 0xFF {red} 0x5A {green} 0x14 {blue} 0xCA // expected: colorCode = 0xFF5A14CA \ No newline at end of file diff --git a/sa/snippets/SAMPFUNCS/0B6B.txt b/sa/snippets/SAMPFUNCS/0B6B.txt new file mode 100644 index 00000000..a643af16 --- /dev/null +++ b/sa/snippets/SAMPFUNCS/0B6B.txt @@ -0,0 +1,3 @@ +int textFont = SF_RENDER_CREATE_FONT {fontname} "Calibri" {size} 9 {flags} 0x04 +int textWidth = SF_RENDER_GET_DRAW_WIDTH_OF_TEXT_WITH_FONT textFont {text} "Hello World!" +// do something to textWidth \ No newline at end of file diff --git a/sa/snippets/SAMPFUNCS/0B6C.txt b/sa/snippets/SAMPFUNCS/0B6C.txt new file mode 100644 index 00000000..d1632268 --- /dev/null +++ b/sa/snippets/SAMPFUNCS/0B6C.txt @@ -0,0 +1,3 @@ +int textFont = SF_RENDER_CREATE_FONT {fontname} "Calibri" {size} 9 {flags} 0x04 +int textHeight = SF_RENDER_GET_FONT_DRAW_HEIGHT textFont +// do something to textHeight \ No newline at end of file diff --git a/sa/snippets/SAMPFUNCS/0B6D.txt b/sa/snippets/SAMPFUNCS/0B6D.txt new file mode 100644 index 00000000..8f967a0a --- /dev/null +++ b/sa/snippets/SAMPFUNCS/0B6D.txt @@ -0,0 +1,2 @@ +int textFont = SF_RENDER_CREATE_FONT {fontname} "Calibri" {size} 9 {flags} 0x04 +// do something to textFont \ No newline at end of file diff --git a/sa/snippets/SAMPFUNCS/0B6E.txt b/sa/snippets/SAMPFUNCS/0B6E.txt new file mode 100644 index 00000000..25b287ea --- /dev/null +++ b/sa/snippets/SAMPFUNCS/0B6E.txt @@ -0,0 +1,3 @@ +int textFont = SF_RENDER_CREATE_FONT {fontname} "Calibri" {size} 9 {flags} 0x04 +// do something to textFont +SF_RENDER_DELETE_FONT textFont // free renderfont object from memory \ No newline at end of file diff --git a/sa/snippets/SAMPFUNCS/0B6F.txt b/sa/snippets/SAMPFUNCS/0B6F.txt new file mode 100644 index 00000000..8cf35f18 --- /dev/null +++ b/sa/snippets/SAMPFUNCS/0B6F.txt @@ -0,0 +1,2 @@ +int textFont = SF_RENDER_CREATE_FONT {fontname} "Calibri" {size} 9 {flags} 0x04 +SF_RENDER_DRAW_TEXT_WITH_FONT textFont {text} "Hello World" {coordx} 400 {coordy} 215 {color} 0xFFFF0000 // write a red colored "Hello World" at screen \ No newline at end of file diff --git a/sa/snippets/SAMPFUNCS/0B70.txt b/sa/snippets/SAMPFUNCS/0B70.txt new file mode 100644 index 00000000..a82444f8 --- /dev/null +++ b/sa/snippets/SAMPFUNCS/0B70.txt @@ -0,0 +1 @@ +SF_RENDER_DRAW_POLYGON {coordx} 500 {coordy} 308 {width} 300 {height} 218 {cornercount} 5 {heading} 60.0 {color} 0xFF00FF00 // draw a green pentagon \ No newline at end of file diff --git a/sa/snippets/SAMPFUNCS/0B71.txt b/sa/snippets/SAMPFUNCS/0B71.txt new file mode 100644 index 00000000..c41bacdb --- /dev/null +++ b/sa/snippets/SAMPFUNCS/0B71.txt @@ -0,0 +1,2 @@ +int myTexture = SF_RENDER_LOAD_TEXTURE_FROM_FILE {filepath} "pic.png" +// do something to myTexture \ No newline at end of file diff --git a/sa/snippets/SAMPFUNCS/0B72.txt b/sa/snippets/SAMPFUNCS/0B72.txt new file mode 100644 index 00000000..847d43a0 --- /dev/null +++ b/sa/snippets/SAMPFUNCS/0B72.txt @@ -0,0 +1,3 @@ +int myTexture = SF_RENDER_LOAD_TEXTURE_FROM_FILE {filepath} "pic.png" +// do something to myTexture +SF_RENDER_RELEASE_TEXTURE myTexture // free from memory \ No newline at end of file diff --git a/sa/snippets/SAMPFUNCS/0B73.txt b/sa/snippets/SAMPFUNCS/0B73.txt new file mode 100644 index 00000000..7bd740a7 --- /dev/null +++ b/sa/snippets/SAMPFUNCS/0B73.txt @@ -0,0 +1,3 @@ +int myTexture = SF_RENDER_LOAD_TEXTURE_FROM_FILE {filepath} "pic.png" +SF_RENDER_DRAW_TEXTURE myTexture {coordx} 723 {coordy} 333 {width} 50 {height} 30 {heading} 180.0 {contrast} 0xFFFFFFFF // show 100px by 75px picture upside down +SF_RENDER_RELEASE_TEXTURE myTexture \ No newline at end of file diff --git a/sa/version.txt b/sa/version.txt index 165b894a..643c34f9 100644 --- a/sa/version.txt +++ b/sa/version.txt @@ -1 +1 @@ -0.870 \ No newline at end of file +0.871 \ No newline at end of file