Click here to Skip to main content
15,902,189 members

Comments by strangerick (Top 28 by date)

strangerick 18-Sep-21 7:31am View    
I need the sprites to be sliced automatically based on their size and the current resolution of the screen so they don't get stretched when drawing to different resolutions.
strangerick 18-Sep-21 7:17am View    
Hello and thanks for the comment. The code posted in my previous question works but i need something more advanced for my needs, that's why i'm searching for a more complete library.
strangerick 15-Sep-21 10:42am View    
Hey, thanks for the comment. I happened to fix the problem by changing some values and modifying the code a bit, so thanks for the answer, it works now.
strangerick 15-Sep-21 9:12am View    
This code seems to only tile the texture, not slice them into smaller textures the way i need. What can i do to accomplish this?
strangerick 15-Sep-21 8:36am View    
Hey, sorry for bothering, your method works but there is one part of the image missing and sometimes it just tiles the texture i don't know why, could you explain how to use it properly or improve it?

i'm drawing it like this:

var rect = new RectangleF(0, 0, 512, 512);
var cells = RectFToRectsF(rect, 3, 3);

foreach (var cell in cells)
{
e.Graphics.DrawImage(texture, rect, cell, GraphicsUnit.Pixel);
}

The image i'm drawing now is 190x49.