In the following code:
// sprite is assigned to variable
let mut br_sprite = Sprite::from_texture(br_tex.clone());
I will have many of these sprites, so I want to do this:
let mut generic_sprite = &br_sprite;
....and the reason I'm assigning the reference of br_sprite is so it will not be moved into the generic sprite variable, so I may use br_sprite again later..... I want use the generic_sprite var in an event loop so whatever sprite I assign to generic_sprite will be used like this:
generic_sprite.set_position(loc[0], loc[1]);
but when I do the
generic_sprite.set_position(loc[0], loc[1]);
statement I get:
cannot borrow `*generic_sprite` as mutable, as it is behind a `&` reference
cannot borrow as mutablerustc(E0596)
so how do I do it? (get the generic_sprite idea to work)
SamQ