Some useful functions for textdraws?
#1

Hello, since some time ago i was figuring out some new textdraw functions, specifically, preview models. Since i started designing my systems and started using preview models, i've figured out how good should be if we could re-texture objects (as the same way we can do in-game) into preview model, change their color etc and show the TextDrawPreviewModel to the players.

Why its not useless? Why do it?

Because we could do a lot of "new own objects" using retexturing and use it on our preview models, like my inventory system:

Inventory video demo



Some examples of "customized objects":

-Medical stuff
-Furniture items modfied
-Custom general objects and buidings

So here are my suggestions:

Quote:

native TextDrawSetPreviewMaterial(Text:textid, materialindex, modelid, txdname[], texturename[], materialcolor);
native PlayerTextDrawSetPreviewMaterial(playerid, PlayerText:text, materialindex, modelid, txdname[], texturename[], materialcolor);

[new suggestions]:

native TextDrawSetPreviewMaterialText(Text:textid, text[], materialindex, materialsize, fontface[], fontsize, bold , fontcolor, backcolor, textalignment);

native PlayerTextDrawSetPreviewMaterialText(playerid, PlayerText:text, ...);

native TextDrawSetRotation( Text:textid, Float:rx, Float:ry, Float:rz);

native PlayerTextDrawSetRotation(playerid, PlayerText:text, Float:rx, Float:ry, Float:rz);


Some other ideas:

Quote:

-Game objects in textdraws, retexture and retext them before seting to preview.
-native TextDrawSetPreviewObject(Text:textid, objectid)//insert game modified objects into preview models
-native PlayerTextDrawSetPreviewObject(playerid, PlayerText:text, objectid)//insert game modified objects into preview models

It should help us to do innovations on our own servers, what do you guys think?
Reply
#2

new textdraws fonts would be awesome
Reply
#3

Quote:
Originally Posted by adri1
View Post
new textdraws fonts would be awesome
Indeed, should be an nice improvement too, we need some more updates on textdraws stuff.
Reply
#4

I agree, it would be nice to have some new functions. Maybe some dynamic textdraws like progress bars with some lines, I don't know exactly.

Btw, that system with textdraws that you've made is so awesome. Nice job!
Reply
#5

Code:
native TextDrawSetPreviewMaterial(Text:text, materialindex, modelid, txdname[], texturename[], materialcolor);
native TextDrawSetPreviewMaterialText(Text:text, (objectid, text[], materialindex = 0, materialsize = OBJECT_MATERIAL_SIZE_256x128, fontface[] = "Arial", fontsize = 24, bold = 1, fontcolor = 0xFFFFFFFF, backcolor = 0, textalignment = 0);
native PlayerTextDrawSetPreviewMaterial(playerid, PlayerText:text, materialindex, modelid, txdname[], texturename[], materialcolor);
native PlayerTextDrawSetPreviewMaterialText(playerid, PlayerText:text, text[], materialindex = 0, materialsize = OBJECT_MATERIAL_SIZE_256x128, fontface[] = "Arial", fontsize = 24, bold = 1, fontcolor = 0xFFFFFFFF, backcolor = 0, textalignment = 0);
Support, but I think we have a more simple way for it: change TextDrawSetPreviewModel to TextDrawSetPreviewObject and change ID from modelid to objectid. And after all changes of material we can use object for preview.
Reply
#6

Quote:
Originally Posted by OKStyle
View Post
Code:
native TextDrawSetPreviewMaterial(Text:text, materialindex, modelid, txdname[], texturename[], materialcolor);
native TextDrawSetPreviewMaterialText(Text:text, (objectid, text[], materialindex = 0, materialsize = OBJECT_MATERIAL_SIZE_256x128, fontface[] = "Arial", fontsize = 24, bold = 1, fontcolor = 0xFFFFFFFF, backcolor = 0, textalignment = 0);
native PlayerTextDrawSetPreviewMaterial(playerid, PlayerText:text, materialindex, modelid, txdname[], texturename[], materialcolor);
native PlayerTextDrawSetPreviewMaterialText(playerid, PlayerText:text, text[], materialindex = 0, materialsize = OBJECT_MATERIAL_SIZE_256x128, fontface[] = "Arial", fontsize = 24, bold = 1, fontcolor = 0xFFFFFFFF, backcolor = 0, textalignment = 0);
Support, but I think we have a more simple way for it: change TextDrawSetPreviewModel to TextDrawSetPreviewObject and change ID from modelid to objectid. And after all changes of material we can use object for preview.
Thanks for contribution, i appreciate the idea of pre-processed objects for TextDraws, so we could modify some object before using it on a textdraw, should be easier for Kalcor (i think) and awesome. Ill be changing the topic and adding your suggestions when i come to PC
Reply
#7

And while at it... Textdraw rotation functions would be nice too..
Reply
#8

Quote:
Originally Posted by Cell_
View Post
And while at it... Textdraw rotation functions would be nice too..
Rotation should be scriptable if Kalcor do the TextDrawSetPreviewMaterialText, so we could change the object to text and rotate the preview model, pretty easy
Reply
#9

Rotate textdraws:
Reply
#10

Quote:
Originally Posted by OKStyle
View Post
Code:
native TextDrawSetPreviewMaterial(Text:text, materialindex, modelid, txdname[], texturename[], materialcolor);
native TextDrawSetPreviewMaterialText(Text:text, (objectid, text[], materialindex = 0, materialsize = OBJECT_MATERIAL_SIZE_256x128, fontface[] = "Arial", fontsize = 24, bold = 1, fontcolor = 0xFFFFFFFF, backcolor = 0, textalignment = 0);
native PlayerTextDrawSetPreviewMaterial(playerid, PlayerText:text, materialindex, modelid, txdname[], texturename[], materialcolor);
native PlayerTextDrawSetPreviewMaterialText(playerid, PlayerText:text, text[], materialindex = 0, materialsize = OBJECT_MATERIAL_SIZE_256x128, fontface[] = "Arial", fontsize = 24, bold = 1, fontcolor = 0xFFFFFFFF, backcolor = 0, textalignment = 0);
Support, but I think we have a more simple way for it: change TextDrawSetPreviewModel to TextDrawSetPreviewObject and change ID from modelid to objectid. And after all changes of material we can use object for preview.
*Cough* VEHICLE MODELS *Cough*

And this, PlayerTextDrawSetPreviewMaterialText, is extremely long. The compiler does have a limit on how long a function name can be ya know.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)