м
Size: a a a
м
P+
P+
м
P+
P+
P+
text1
or figures
N
м
text1
or figures
N
D
N
N
N
A
A
P+
struct InputText<'a> {
x: f32,
y: f32,
w: f32,
h: f32,
rgba: [Color; 2],
text: &'a str,
size: i32,
border: [f32; 2],
q: &'a PrimitivesAddon,
moveindex: usize,
}
impl <'a>InputText<'a> {
fn new(x_pos: f32, y_pos: f32, w_pos: f32, h_pos: f32, colorrgba: [Color; 2], text1: &'a str, size1: i32, border1: [f32; 2], figures: &'a PrimitivesAddon) -> InputText {
InputText {
moveindex: 0,
x: x_pos,
y: y_pos,
w: w_pos,
h: h_pos,
rgba: colorrgba,
text: text1,
size: size1,
border: border1,
q: figures,
}
}
fn draw(&self) {
self.q.draw_filled_rectangle(self.x, self.y, self.w, self.h, self.rgba[self.moveindex]);
}
fn click(&mut self) {
unsafe {
if FASIW::get_x() > self.x && FASIW::get_x() < self.w && FASIW::get_y() > self.y
&& FASIW::get_y() < self.h
{
self.moveindex = 1;
} else {
self.moveindex = 0;
}
}
}
fn focus()
{
}
}
D
сделай
-> Self
вместо -> InputText
D
-> InputText<'a>
м
-> InputText<'a>