Questions tagged [blit]

BLock Image Transfer - Involves copying one bitmap onto another using a raster operator.

303 questions
2
votes
1 answer

Double buffering in x86 VGA

To bring back some memories I decided to sit down and code a little assembler game in VGA mode 13h - until the point I realized the visual output is flickering as hell. At first I suspected it might be my clearscreen routine. Indeed by using a STOSW…
obscure
  • 11,916
  • 2
  • 17
  • 36
2
votes
1 answer

How do you make a Sprite blitting twice have two separate collision boxes in Pygame?

I don't know if my title was very clear, so I'm going to try to explain this more clearly here. So I have a Sprite in Pygame called spikes. I want there to be more than one spikes so I blit a second one. Problem is, my spike_collision box only…
Duck Duck
  • 159
  • 6
2
votes
1 answer

Why is my Pygame sprite rotating like a collision box?

Right, so this is out of all the questions and bugs I have had in Python/Pygame, the strangest one to me. So I just learned how to rotate something in Pygame and it was working fine with everything else except this one sprite. This is what rotates…
Duck Duck
  • 159
  • 6
2
votes
1 answer

How to render/blit text in pygame for good performance

I am working on a small game (as a hobby) using Pygame. Before this I never worked on graphical interfaces and I am encountering some performance issues. Even in the options menu the FPS seem to be capped at around 110, which maybe doesn't sound…
korn55
  • 153
  • 5
2
votes
1 answer

Unwanted symbol in text when using blit from pygame

When using the blit function to show text from a file (each line ends with a number - 1 in this case), it shows an unwanted box. This happens for all lines in the file. How do I get rid of it? I know it would maybe work if a comma is put at the end…
2
votes
1 answer

Pygame: How can I rotate a surface area without blitzing the images twice?

I'm trying to rotate the whole screen, and all the objects on the surface. But when I blit the surface it just creates a new one, leaving me with four. In other words; I have two images that are not rotating, and two that are. I want to remove the…
Three Point 14
  • 150
  • 2
  • 8
2
votes
1 answer

OpenGL full screen texture brings framerate down to 12fps

I installed linux (Debian) on an old laptop and have been writing an OpenGL application with it. The framerate cruises at about 80fps when drawing a texture on a small portion of the screen. When I draw the texture on a bigger and bigger portion of…
William S
  • 54
  • 4
2
votes
1 answer

Copy Metal frame buffer to MTLTexture with different Pixel Format

I need to grab the screen pixels into a texture to perform post processing. Previously, i have been using BlitCommandEncoder to copy from texture to texture. Source texture being the MTLDrawable texture, onto my destination texture. They both have…
Darren
  • 152
  • 9
2
votes
2 answers

How to display text from inside a class

I am trying to blit a 'P' as text onto a chessboard. Even following previous help on how to blit squares, I am not able to do it with text. This variation of a chess game is played with pikemen, archers, and knights. The 'P' stands for pikeman. In…
Techoplite
  • 605
  • 9
  • 23
2
votes
1 answer

Blit white squares on a chessboard by passing coordinates

My problem is that I cannot properly blit several squares in the right position. I have written some code to display a chessboard. The squares are not sprites, but pygame.Surface objects. My project contains two .py files at the moment: display.py…
Techoplite
  • 605
  • 9
  • 23
2
votes
1 answer

In pygame, how do I blit an image when I collide with something and make it stay?

So I have been using a slightly modified version of the python script from the first answer here and I added a class called "SpeechBlock" by adding it here: level = [ "PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP", …
2
votes
2 answers

matplotlib animation save is not obeying blit=True but it seems to work just fine in plt.show()

I'm quite new to Python and am trying to animate text using matplotlib. used several online examples to arrive at the following code: import matplotlib.pyplot as plt import matplotlib.animation as animation fig, ax =…
2
votes
3 answers

Blitting a Surface onto another without combining alpha

In a pygame project I'm working on, sprites of characters and objects cast a shadow onto the terrain. Both the shadow and the terrain are normal pygame surfaces so, to show them, the shadow is blitted onto the terrain. When there's no other shadow…
2
votes
1 answer

How can I keep the last animation frame with blit = True

I have to set blit = true, since the plotting is much faster. But after animation (repeat = false), if I use zoom in the figure, the figure will just disappear. I need to keep the last frame so that I can zoom in the last figure.
2
votes
1 answer

Pygame doesn't blit images onto canvas

I've made an icon for a gui in a little project I'm working on, and pygame doesn't display it. What am I doing wrong? import pygame black = (0,0,0) toolscanvas = pygame.Surface((700,120)) pygame.init() gameDisplay =…
Anonymous
  • 131
  • 8