added slider thing, broke rendering somehow though

This commit is contained in:
2020-08-01 20:06:53 -07:00
parent 8da810f23a
commit f3a3be1d99
12 changed files with 78 additions and 52 deletions

View File

@@ -2,13 +2,13 @@ use std::sync::Arc;
use crate::canvas::*;
use crate::canvas::managed::handles::{CanvasFontHandle, CanvasImageHandle, CanvasTextureHandle, Handle};
use crate::canvas::canvas_frame::{Drawable, Eventable};
use crate::util::vertex::{VertexTypes, TextureVertex3D, Vertex3D};
use crate::util::vertex::{VertexType, TextureVertex3D, Vertex3D};
use winit::event::{DeviceEvent, MouseButton, ElementState, Event, WindowEvent};
///
#[derive(Debug, Clone)]
pub struct Sprite {
verts: VertexTypes,
verts: VertexType,
position: (f32, f32),
size: (f32, f32),
@@ -55,7 +55,7 @@ impl Sprite {
let normalized_depth = (depth as f32 / 255.0);
Sprite {
verts: VertexTypes::TextureType(Sprite::generate_verts(position, size, normalized_depth), texture_handle.clone()),
verts: VertexType::TextureType(Sprite::generate_verts(position, size, normalized_depth), texture_handle.clone()),
position: position,
size: size,
depth: normalized_depth,
@@ -65,9 +65,9 @@ impl Sprite {
}
impl Drawable for Sprite {
fn get(&self) -> Vec<VertexTypes> {
fn get(&self) -> Vec<VertexType> {
vec![
VertexTypes::TextureType(
VertexType::TextureType(
Sprite::generate_verts(self.position, self.size, self.depth),
self.texture_handle.clone())
]