AtlasTexture
This commit is contained in:
parent
cb224283db
commit
0d5b18f458
4 changed files with 122 additions and 1 deletions
BIN
assets/atlas.png
Normal file
BIN
assets/atlas.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
97
assets/atlas.svg
Normal file
97
assets/atlas.svg
Normal file
|
|
@ -0,0 +1,97 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
width="1920"
|
||||||
|
height="1080"
|
||||||
|
viewBox="0 0 1920 1080"
|
||||||
|
version="1.1"
|
||||||
|
id="svg1"
|
||||||
|
inkscape:version="1.4.2 (ebf0e940d0, 2025-05-08)"
|
||||||
|
sodipodi:docname="atlas.svg"
|
||||||
|
inkscape:export-filename="atlas.png"
|
||||||
|
inkscape:export-xdpi="96"
|
||||||
|
inkscape:export-ydpi="96"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg">
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="namedview1"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#111111"
|
||||||
|
borderopacity="1"
|
||||||
|
inkscape:showpageshadow="0"
|
||||||
|
inkscape:pageopacity="0"
|
||||||
|
inkscape:pagecheckerboard="1"
|
||||||
|
inkscape:deskcolor="#d1d1d1"
|
||||||
|
inkscape:document-units="px"
|
||||||
|
inkscape:zoom="0.5"
|
||||||
|
inkscape:cx="818"
|
||||||
|
inkscape:cy="503"
|
||||||
|
inkscape:window-width="1890"
|
||||||
|
inkscape:window-height="1012"
|
||||||
|
inkscape:window-x="0"
|
||||||
|
inkscape:window-y="0"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:current-layer="layer1" />
|
||||||
|
<defs
|
||||||
|
id="defs1" />
|
||||||
|
<g
|
||||||
|
inkscape:label="Layer 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1">
|
||||||
|
<g
|
||||||
|
id="g7"
|
||||||
|
transform="matrix(5.6603117,0,0,5.6603117,-524.28637,-261.14501)">
|
||||||
|
<rect
|
||||||
|
style="fill:#d7c0b4;fill-opacity:1;stroke:none;stroke-opacity:1"
|
||||||
|
id="rect1-6"
|
||||||
|
width="44.727272"
|
||||||
|
height="63.272728"
|
||||||
|
x="93.125"
|
||||||
|
y="46.636154"
|
||||||
|
ry="4.6061144" />
|
||||||
|
<path
|
||||||
|
d="M 137.85191,92.272164 H 93.125353 v 13.029296 c 0,2.55179 2.053681,4.60742 4.605469,4.60742 h 35.515618 c 2.55179,0 4.60547,-2.05563 4.60547,-4.60742 z"
|
||||||
|
style="fill:#b89c8d;fill-opacity:1;stroke:none;stroke-opacity:1"
|
||||||
|
id="path6" />
|
||||||
|
<rect
|
||||||
|
style="fill:none;fill-opacity:1;stroke:#8b6f57;stroke-opacity:1"
|
||||||
|
id="rect1"
|
||||||
|
width="44.727272"
|
||||||
|
height="63.272728"
|
||||||
|
x="93.125"
|
||||||
|
y="46.636154"
|
||||||
|
ry="4.6061144" />
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g6"
|
||||||
|
transform="matrix(6.4466105,0,0,6.4466105,-291.48878,180.06403)">
|
||||||
|
<circle
|
||||||
|
style="fill:#333a8f;fill-opacity:1;stroke:none;stroke-opacity:1"
|
||||||
|
id="path2"
|
||||||
|
cx="79.977272"
|
||||||
|
cy="23.113636"
|
||||||
|
r="4.4490924" />
|
||||||
|
<path
|
||||||
|
d="m 84.352399,23.924183 c -1.842583,-0.133374 -3.612919,-1.030539 -5.410156,-1.330078 -0.959384,-0.159898 -2.058666,0.03909 -2.966797,0.341797 -0.137414,0.0458 -0.29102,0.10665 -0.447266,0.177734 a 4.4490924,4.4490924 0 0 1 0,0.002 4.4490924,4.4490924 0 0 0 4.449219,4.449219 4.4490924,4.4490924 0 0 0 4.375,-3.640625 z"
|
||||||
|
style="fill:#18229c;fill-opacity:1"
|
||||||
|
id="path4" />
|
||||||
|
<circle
|
||||||
|
style="fill:none;fill-opacity:1;stroke:#09118b;stroke-opacity:1"
|
||||||
|
id="path2-3"
|
||||||
|
cx="79.977272"
|
||||||
|
cy="23.113636"
|
||||||
|
r="4.4490924" />
|
||||||
|
</g>
|
||||||
|
<rect
|
||||||
|
style="fill:#6e4b37;fill-opacity:1;stroke:#50351e;stroke-width:5.66031;stroke-opacity:1"
|
||||||
|
id="rect8"
|
||||||
|
width="160.61134"
|
||||||
|
height="160.61134"
|
||||||
|
x="261.66077"
|
||||||
|
y="2.8301561"
|
||||||
|
ry="0" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 3.2 KiB |
18
src/lofpara_atlas.rs
Normal file
18
src/lofpara_atlas.rs
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
use bevy::prelude::*;
|
||||||
|
|
||||||
|
#[derive(Resource)]
|
||||||
|
pub struct LofparaAtlas(TextureAtlasLayout);
|
||||||
|
|
||||||
|
pub struct LofparaAtlasPlugin;
|
||||||
|
|
||||||
|
impl Plugin for LofparaAtlasPlugin {
|
||||||
|
fn build(&self, app: &mut App) {
|
||||||
|
let mut atlas = TextureAtlasLayout::new_empty(UVec2::new(1920, 1080));
|
||||||
|
//Card, index = 0
|
||||||
|
atlas.add_texture(URect::new(0, 0, 258, 363));
|
||||||
|
//Cardholder, index = 1
|
||||||
|
atlas.add_texture(URect::new(259, 0, 166, 166));
|
||||||
|
|
||||||
|
app.insert_resource(LofparaAtlas(atlas));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,3 +1,9 @@
|
||||||
|
use bevy::prelude::*;
|
||||||
|
|
||||||
|
use crate::lofpara_atlas::LofparaAtlasPlugin;
|
||||||
|
|
||||||
|
mod lofpara_atlas;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("Hello, world!");
|
App::new().add_plugins((DefaultPlugins, LofparaAtlasPlugin));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue