1
\$\begingroup\$

I am new to pygame. I was searching on the internet and the pygame documentation for the functions which can translate, rotate, scale the entire graphics Context, but I couldn't find them. I know that I can apply transformations on individual surfaces using functions that are present in pygame.transform module, but I couldn't find the functions that will apply transformations to the graphics context itself. Are these functions in a different module or they don't exist?

\$\endgroup\$
  • 2
    \$\begingroup\$ What are you trying to do? Some graphics APIs (Java for instance) are context based, but pygame is surface based. Knowing what you're trying to accomplish might be more helpful than answering the question as is. \$\endgroup\$ – Pikalek Mar 8 '18 at 2:17
  • \$\begingroup\$ @Pikalek "Some graphics APIs (Java for instance) are context based, but pygame is surface based" - that's all I needed to know. Thanks! \$\endgroup\$ – arandomguy Mar 8 '18 at 8:27
  • \$\begingroup\$ Ok, glad to help. To avoid the 'answered in comments' problem, I've posted the info as a proper answer. \$\endgroup\$ – Pikalek Mar 8 '18 at 14:46
1
\$\begingroup\$

The short answer is: they don't exist.

Some graphics APIs (Java's Graphics2D for instance) are context oriented, but as you've discovered, Pygame orients its drawing functionality on Surfaces. All the functions for drawing & transforms target a Surface passed as an arguement.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.