smarts1l
smarts1l
CC#
Created by smarts1l on 7/23/2024 in #help
Trying to convert TMX loading Python Code into C#
How would i translate this: tmx_data = load_pygame('../data/map.tmx') for layer in ['HouseFloor', 'HouseFurnitureBottom']: for x, y, surf in tmx_data.get_layer_by_name(layer).tiles(): Generic((x * TILESIZE,y * TILESIZE), surf, self.all_sprites, LAYERS['house bottom']) into C#? I am using Raylib as the texture controller and the group is a list called SpritesList and the Texture is just called SpriteImage.
5 replies
CC#
Created by smarts1l on 11/24/2023 in #help
Error with getting pixels
I have tried to create some code to get the pixels of an uploaded image but the function doesn't seem to work correctly. It gives extremely strange outputs so it isn't that the r,g,b values are looking at the wrong index in the array. It does work for black and white but no colours. Does anyone know why? This is the part of my code where the error occurs var pixelData = createBytes(width, height); string oldr = "0", oldb = "0", oldg = "0"; string[] compressed = new string[height * width]; int godown = 0; var path = op.FileName; for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) {
int index = y * (width*4) + 4 * x; byte blue = pixelData[index]; byte green = pixelData[index + 1]; byte red = pixelData[index + 2]; int arraySlot = x +(y*width);int StandardArraySlot = arraySlot - godown; string r = red.ToString("D3"); string g = green.ToString("D3"); string b = blue.ToString("D3"); MessageBox.Show(r+" "+g+" "+b); public byte[] createBytes(int width,int height) { int stride = width * 4; byte[] pixelData = new byte[height * stride]; image.CopyPixels(new Int32Rect(0, 0, width, height), pixelData, stride, 0); return pixelData;

}
15 replies
CC#
Created by smarts1l on 11/12/2023 in #help
C# Change Folder Icon
I want to be able to create a very basic program that will be able to change the icon of a folder to something else automatically. Does anyone know how I would go about doing this as i cant find a tutorial elsewhere on the internet
6 replies
CC#
Created by smarts1l on 10/26/2023 in #help
❔ ✅ running a c# program without opening visual studio
How do i run a c# program without opening visual studio on .net framework?
8 replies