Module util

Source
Expand description

common tools and data structures: object pool, RNG, matrix, circle, dots Utilities for random, rect, PointU16… and a simple object pool: objpool.rs Some primitive algorithms: shape.rs

Modules§

objpool
This module implements a simple object pool. It is designed for object recycling, reducing costs for creating objects.
shape
Implements some shape drawing algorithms.

Structs§

ARect
Particle
ParticleSystem
ParticleSystemInfo
PointF32
PointI16
PointI32
PointU16
Rand
Random number generator (RNG) wrapper.
RandLCG
封装LCG随机数生成器, 随机效果不好 但是在跟其他语言系统交互时,如果其他系统没有xoshiro实现 为了获得一致的随机数序列可以采用
Rect

Enums§

Dir

Functions§

get_abs_path
get_file_name
get_pixel_root_path
Gets the absolute path of the root of RustPixel. In fact, it looks for where Cargo.lock locates When deploying, users can run the CMD: cargo install –bin city –path games/city –root ~/PIXEL and then put a Cargo.lock file and assets folder at bin/xxx By doing this, binary executables can locate pixel_root_path and have access to resources under the assets folder
get_project_path
Intelligently determines the project path based on command line arguments and environment variables.
get_project_root
get flag_file path…