How to create textures at coord?
-
https://gyazo.com/b2cc20ff75029e966d9921363a11b378 How do you make textures like these appear at a specified coord in the game world? I am using C#
-
@-FLUX123- You can create your own textures and add a texture library with Open IV.
void DRAW_SPRITE(const char* textureDict, const char* textureName, float screenX, float screenY, float width, float height, float heading, int red, int green, int blue, int alpha, BOOL p11) // 0xE7FFAE5EBF23D890 0x1FEC16B0 b323
Draws a 2D sprite on the screen.
Parameters:
textureDict - Name of texture dictionary to load texture from (e.g. "CommonMenu", "MPWeaponsCommon", etc.)textureName - Name of texture to load from texture dictionary (e.g. "last_team_standing_icon", "tennis_icon", etc.)
screenX/Y - Screen offset (0.5 = center)
scaleX/Y - Texture scaling. Negative values can be used to flip the texture on that axis. (0.5 = half)heading - Texture rotation in degrees (default = 0.0) positive is clockwise, measured in degrees
red,green,blue - Sprite color (default = 255/255/255)
alpha - opacity level
-
@JohnFromGWN This is used to draw a sprite on screen, what I want is to draw a "sprite" or texture at a specific point (in the game world) so not on the game HUD or screen.
-
@-FLUX123- Got it. What you want is a 2D prop then? You will need to create your own prop then or modify the texture of an existing one.
myProp = World.CreateProp("prop_b_board_blank", myPos, new Vector3(0f, 0f, 25.0854f), false, false);
public static Prop CreateProp(Model model, Vector3 position, bool dynamic, bool placeOnGround);
public static Prop CreateProp(Model model, Vector3 position, Vector3 rotation, bool dynamic, bool placeOnGround);
-
@JohnFromGWN said in How to create textures at coord?:
"prop_b_board_blank"
How exactly do you modify the texture of the prop then?
-
@-FLUX123- It depends on the prop. You can use codewalker's rpf explorer, you can use the texture toolkit, sometimes just an image editor like Photoshop if you're only doing a texture change. You can export ydr as ydr or export to openformat from OpenIV.
To add a prop you can use this mod.
https://www.gta5-mods.com/tools/addonprops
-
@-FLUX123- Here are examples of props I created when I first started modding. Instead of just replacing textures in an existing prop I cloned the props and changed the textures. This included walls, tables, chairs, lockers, paintings, green boards, etc.
You can position these props or 2d sprites wherever you want using the function above or you can do it manually with your trainer.
-
@JohnFromGWN yea I guess you could do it this way but is there really not a simpler way? I mean you can spawn Props, Vehicles, effects, NPC's, weapons, and so much more but there's no way to display simple 2D textures at a set location? There must be some simple way to display 2D textures but I just can't figure out how...
It's maybe like, "DRAW_SCALEFORM_MOVIE_3D" or something like that but I haven't gotten it to work.
-
@-FLUX123- AfAIK you can't spawn a sprite like you would a 3D object, but you can with a 2D prop. You could easily create a 2D model as a prop or use an existing prop and change its texture. The problem with existing props is your limited to their dimensions. So you might find a 256 x 256 prop for example when you want one that is 512 x 256. Changing a texture is very easy and you only need to do it once. Then you spawn your prop as you would any other prop.
Anyway I could be wrong about the sprites, but honestly creating a 2D image (as a prop texture) and placing it wherever you want is about as simple as it gets.
-
@-FLUX123- you can swap an existing texture of a new one in less than a minute.