SOLVED in the middle of the sprite

Started by , Wed 25/04/2007 04:15:51

Previous topic - Next topic

bicilotti

LucasArts style game.

I'm trying to place the speech of my character (dialogues, interactions with objiects etc) OVER his/her head.

i've added the SetSpeechStyle(eSpeechLucasarts); in the global script but the text is still displayed somewhere below the middle of the sprite.

Any help?

Khris

Where exactly did you put this command?
Btw, you can set the speech style in the General settings pane, too.

bicilotti

Code: ags
function game_start() {

SetSpeechStyle(eSpeechLucasarts); //TIPO DI VISUALIZZAZIONE
Game.NormalFont = 1; // DECIDE IL TIPO DI CARATTERE
Game.SpeechFont = 1;


I used the LecScumm 1.5 template on a 640x480 game

Khris

That's weird, to say the least.
I assume you do use Character.Say commands, right?
Afaik, the text position is calculated using the coordinates and sprite height of the char, could you post a screenshot?

The aren't any transparent chars around who might do the actual talking?

bicilotti

Code: ags

function unhandled_event (int what, int type) {
  SetSpeechStyle(eSpeechLucasarts); 
  //all the unhandled_events for various things.
  if ((what==1)&&(type==8)) { //hotspot
         if (GetGlobalInt(10)==1){ character[EGO].Say ("I can't give that.");}
    else if (GetGlobalInt(10)==2){ character[EGO].Say ("I won't pick that uppe.");}
    else if (GetGlobalInt(10)==3){ DisplaySpeech (EGO, "Using that won't do me any good.");}
    else if (GetGlobalInt(10)==4){ DisplaySpeech (EGO, "That won't open.");}
    else if (GetGlobalInt(10)==5){ DisplaySpeech (EGO, "It won't reply.");}
    else if (GetGlobalInt(10)==6){ DisplaySpeech (EGO, "I can't push that,");}
    else if (GetGlobalInt(10)==7){ DisplaySpeech (EGO, "That won't close.");}
    else if (GetGlobalInt(10)==8){ GetLocationName(mouse.x,mouse.y,placer); DisplaySpeech (EGO, "Nice %s", placer);}
    else if (GetGlobalInt(10)==9){ DisplaySpeech (EGO, "Pulling that won't do me good.");}
    else if(GetGlobalInt(10)==10){ DisplaySpeech (EGO, "I don't think it'd want that.");}
    else if(GetGlobalInt(10)==11){ DisplaySpeech (EGO, "That won't shed any light on things.");}}
  if ((what==2)&&(type==6)) { //object


i used the old "displayspeech", but even if i choose the new "character.say" it is still the same old story.




Khris



Khris

I'm at my wits' end here, sorry.
I've never seen anything like this with AGS.
It looks like the speech was placed above the char pivot's y, not y-sprite height.

What happens if you enable the walkable area's scaling and make the character talk at different zoom levels?

bicilotti

Quote from: KhrisMUC on Wed 25/04/2007 22:57:17

What happens if you enable the walkable area's scaling and make the character talk at different zoom levels?

You did it!!!! I set the zoom at 101% and everithing worked ok!

Khris

That's cool, but this is still a notable glitch.

101% percent isn't far off but probably enough to add an extra line of pixels to character sprites exceeding a height of, say, 100 pixels, which isn't really that much. I wouldn't want that to happen to my sprites, so I'd be curious about an explanation.

SMF spam blocked by CleanTalk