• Can I use sprite instead of bunch of small images (DrawTexturedRect or something)
    4 replies, posted
So, Can I or not?
What do you want to 'use' it for?
[QUOTE=MPan1;49629538]What do you want to 'use' it for?[/QUOTE] For buttons, I have nearly 30 icons for different buttons or differents states of them. I mean Can I use single sprite image file instead of bunch of different icons? Something like: DrawTexturedRect(posx, posy, width, height, image_path, image_startx, image_starty, image_endx, image_endy)
Well, [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/surface/DrawTexturedRectUV]surface.DrawTexturedRectUV[/url] lets you choose the starting and ending coordinates of the image/sprite so you can create partial textures, I suppose if you could figure out how to use that it could work. [editline]29th January 2016[/editline] The arguements for that function are out of 0 and 1 though, so you would probably have to divide the start and end positions by your image size for it to work
[QUOTE=MPan1;49629583]Well, [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/surface/DrawTexturedRectUV]surface.DrawTexturedRectUV[/url] lets you choose the starting and ending coordinates of the image/sprite so you can create partial textures, I suppose if you could figure out how to use that it could work. [editline]29th January 2016[/editline] The arguements for that function are out of 0 and 1 though, so you would probably have to divide the start and end positions by your image size for it to work[/QUOTE] Oh, Thanks a lot! I'll grid it on 20x20 pieces and set params like 0.05
Sorry, you need to Log In to post a reply to this thread.