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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34beef1453c19969224b2907680db9dfb881f009bdb4bc0af291ae34bb777e46
|
|
| MD5 |
9fb98feddd3196534abd52a85447bad4
|
|
| BLAKE2b-256 |
66fddeab4af61859bfaceea885b26d0bf49a9ac0b4a3e47a749c49510144f726
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f53704d92027faf09fe80f7471eb7f800afcfd9543e038f6b9160f4f4fea9ca
|
|
| MD5 |
b8dfcbad9d0ebd99535dd65015763bb9
|
|
| BLAKE2b-256 |
677a9c6699b5204d013cd7d591c351e06aa78502144e4deb86edc450a50a80b3
|