ID:170756
 
how do i layer an overlay in the clients screen?

i have a obj that im loading to the screen but i want to be able to add an overlay to it the thing is when its on the screen it uses the FLOAT_LAYER so how do i get round this small problem.
Madpeter wrote:
how do i layer an overlay in the clients screen?

The same as for any other overlay. Create an obj, give it a layer, add it to the overlays list.

Lummox JR
In response to Lummox JR (#1)
thanks it works now

New code
var/obj/Items/R = src.bot1wep
R.layer = T.layer + 1
T.overlays += R


Old code
T.overlays += src.bot1wep
In response to Madpeter (#2)
Madpeter wrote:
thanks it works now

New code
var/obj/Items/R = src.bot1wep
R.layer = T.layer + 1
T.overlays += R


Actually that isn't correct. You're now changing the layer of the weapon itself, which I don't think is at all desirable.

Instead, you need to create a new obj, give it the correct icon, state, and layer, and then add that to overlays. The new obj can then be deleted.

Lummox JR
In response to Lummox JR (#3)
thanks i will give that a try.

this seems to work fine :)
var/obj/Items/R = new()
R.icon = src.bot1wep.icon
R.icon_state = src.bot1wep.icon_state
R.layer = T.layer + 1
T.overlays += R

can you see any errors in that?


In response to Zmadpeter (#4)
Zmadpeter wrote:
can you see any errors in that?

No, but instead, you could be doing:
var/obj/Items/R = new()
R=src.bot1wep
R.layer+=1
T.overlays += R


:)
In response to Wizkidd0123 (#5)
Wizzkids home and he's helping people, of course is what he does best.
=)