rpgx 0.1.3

Lightweight, modular, and extensible RPG game engine 2D, designed for flexibility, portability, and ease of use.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::prelude::{Coordinates, Effect, Layer, Mask, Rect, Shape};

/// Generates a street `Layer` that surrounds the area defined by `shape`.
pub fn ground_layer(shape: Shape, texture_id: u32) -> Layer {
    let mask = Mask::new(
        "street_border".to_string(),
        // Selector::Block(Rect::new(Coordinates { x: 0, y: 0 }, shape)),
        Rect::new(Coordinates { x: 0, y: 0 }, shape).into_many(),
        vec![Effect::Texture(texture_id)],
    );

    Layer::new("street".to_string(), vec![mask], 1)
}