Friday, July 15, 2022
HomeGame Developmenttextures - Blit Floor utilizing vacation spot rect in pygame

textures – Blit Floor utilizing vacation spot rect in pygame


Is there a technique to blit a area of a pygame Floor into one other area on a goal Floor?

If I’ve a display Floor I can blit a portion of one other Floor onto it:

source_rect = Rect(0, 0, 32, 32)
destination_rect = Rect(10, 10, 100, 100)
screen_surface.blit(tiles_surface, destination_rect, source_rect)

The width and the peak of the source_rect are revered, however the width and the peak of the destination_rect are ignored (as is additionally said within the documentation; “The dimensions of the vacation spot rectangle doesn’t impact the blit“).

I wish to take a area of 1 Floor and draw it at a special dimension on one other Floor, what’s the finest method to realize this provided that the scale of the destination_rect could incessantly change?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments