ID:264802
 
Code:
obj/HPBar/
Enemy
icon='EnemyHPBar.dmi'
icon_state="Bar"


Problem description: It's not showing all the bar!!! The bar is a 127x19 Pixels. Any idea?

icon problem
Depends on map_format and how/where you're displaying the bar
In response to Taha123
Taha123 wrote:
icon problem

How can you tell it's an icon problem without seeing the icon?
In response to Darker Legends
Darker Legends wrote:
Taha123 wrote:
icon problem

How can you tell it's an icon problem without seeing the icon?


Experience.
In response to Taha123
Taha123 wrote:
Darker Legends wrote:
Taha123 wrote:
icon problem

How can you tell it's an icon problem without seeing the icon?


Experience.

There's no way you can tell it's an icon problem without seeing it.
In response to Darker Legends
Darker Legends wrote:
Taha123 wrote:
Darker Legends wrote:
Taha123 wrote:
icon problem

How can you tell it's an icon problem without seeing the icon?


Experience.

There's no way you can tell it's an icon problem without seeing it.


Ok we will go by your way. Ocean show use the icon.
As Falacy mentioned, you didn't post enough code for anyone to tell what the issue is. It may be nothing to do with the way the obj is defined, but everything to do with how it's supposed to be displayed.

Lummox JR
In response to Lummox JR
#define DEBUG

world
map_format = TOPDOWN_MAP

obj/HPBar/
Enemy
icon='EnemyHPBar.dmi'
icon_state="Bar"
New(client/A)
screen_loc="10,10"
A.screen+=src

Bar
icon='EnemyHPBar.dmi'
icon_state="1"

client/New()
..()
src.screen += new/obj/HPBar/Enemy/


All the code. Yeah, not alot.
In response to Ocean King
Obviously that is not all the relevant code, or you wouldn't be wondering why the obj isn't showing up because you aren't displaying it anywhere. You've now shown the value of map_format and the code for a separate bar, but you have not shown how they're being displayed. That's kind of a critical piece.

Lummox JR
In response to Lummox JR
Sorry, i updated. Because i tryed 2 forms to add it: Directly from map and when the client enters
In response to Ocean King
Ocean King wrote:
> #define DEBUG
>
> world
> map_format = TOPDOWN_MAP
>
> obj/HPBar/
> Enemy
> icon='EnemyHPBar.dmi'
> icon_state="Bar"
> New(client/A)
> screen_loc="10,10"
> A.screen+=src
>
> Bar
> icon='EnemyHPBar.dmi'
> icon_state="1"
>
> client/New()
> ..()
> src.screen += new/obj/HPBar/Enemy/
>


I would actually recommend adding things to the screen in Login() instead of client/New().

There are some issues with your New() call, but generally it looks like the Enemy bar should be added to the HUD since its screen_loc is being set no matter what. However, that New() call will fail because you're passing null instead of a client when you create the bar, so A.screen is actually null.screen. I suspect fixing that won't fix the problem you're having though.

There are a few possible issues. The most likely is that the icon state "1" does not exist in EnemyHPBar.dmi. Another possibility is that the bar's layer may be too low so that it's displaying beneath other items; this would actually be a good candidate for using OBJ_LAYER+EFFECTS_LAYER.

Lummox JR
In response to Lummox JR
There aren't other icons on the map, just the black background. And the "Bar" with icon_state="1" it's just the red thing inside the "Enemy" (which is the bar). Hmm, i'm going to try that of EFFECTS_LAYER

Falacy: The map format is the default. TOPDOWN.

EDIT: Nothing, is not working. :S

EDIT 2: It's seems to be invisible, it's showing a 32x32 part then all the other part is invisible.
In response to Ocean King
In response to Ocean King
Looks like it shows the entire bar to me, 2 of them actually
In response to Falacy
The ****? How... I can see only a part of them...
In response to Ocean King
Well was trying and i clicked: "Use graphics hardware for displaying maps" and it showed correctly... But slow...
In response to Ocean King
Means your graphics card is too slow to render it.
In response to Teh Governator
What? if i did other things in this same computer, using big icons and showed correctly...
In response to Ocean King
I solved it, touching the BIOS i solved it... Also, i disabled hardware rendering for programs.

Thanks, Falacy, Lummox, Taha and Governator.