Skip to main content

A rotation module

Project description

SC ENGINE

SC-Engine is a rotation engine coded by @SplatCraft

It works with Oz-Engine (or other libraries)

SETUP

In shell, type the following command :

pip install SC-Engine

In your file, write this:

import SC

USE

POINT ROTATION

Let's try to rotate a point around another point !

new = SC.rotate_pixel([1, 1], [3, 3], 180)

# here we are rotating the point at x=1 y=1 around the point at x=3 y=3 to 180 degrees

# this function returns a list of two integers [x,y]

print(new)

Run the project and see what happens

[5, 5]

And those are the new coordinates of the point !

SHAPE ROTATION

sh = [
  ["#","#","#"],
  ["#"," "," "],
  ["#","#","#"]
]

new = SC.rotate_shape(sh, [5,5], [4,6], 90)

# sh  is the shape to rotate
# [5,5]  are the coordinates of the bottom_right corner of the shape
# [4,6]  are the coordinates of the point to rotate the shape around
# 90 is the angle of rotation

print(new)

And it returns this :

[[["#","#","#"],
  ["#"," ","#"],
  ["#"," ","#"]],
 [3,6]]

We can see that there is the rotated shape, and the new bottom right coordinates of the shape

GET CORNER POINT

With this function we want to get the coordinates of a corner of a shape

new = SC.get_corner(sh, [5,5], SC.bottom_right, SC.top_right)

print(new)

And here is the result :

[5,7]

COMPATIBILITY

OZ Engine

Here, new is the output of rotate_shape

import OzEngine as oz


canvas = oz.Canvas(" ")
camera = oz.Camera(canvas, [10,10], [0,0], "cam1")

SC.OzEngine.add_sprites(SC.Format(new.oz_engine()))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

SC-Engine-1.1.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

SC_Engine-1.1.0-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file SC-Engine-1.1.0.tar.gz.

File metadata

  • Download URL: SC-Engine-1.1.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for SC-Engine-1.1.0.tar.gz
Algorithm Hash digest
SHA256 34beef1453c19969224b2907680db9dfb881f009bdb4bc0af291ae34bb777e46
MD5 9fb98feddd3196534abd52a85447bad4
BLAKE2b-256 66fddeab4af61859bfaceea885b26d0bf49a9ac0b4a3e47a749c49510144f726

See more details on using hashes here.

File details

Details for the file SC_Engine-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: SC_Engine-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for SC_Engine-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0f53704d92027faf09fe80f7471eb7f800afcfd9543e038f6b9160f4f4fea9ca
MD5 b8dfcbad9d0ebd99535dd65015763bb9
BLAKE2b-256 677a9c6699b5204d013cd7d591c351e06aa78502144e4deb86edc450a50a80b3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page