ID:270389
 
People, i want to transform the alert proc in a graphical alert that appears in the player's screen.But i want know how, i know the DmiFonts demo, but i want know how to transform it to a alert box(its too small)...
If someone could help...
Uh... What? More detail? More explanation? More legibility?
In response to Jp
have you played pokémon?the mesages dont appear on a txt, they appear graphically on the screen.I want make these rectangles, the "DmiFonts" demo helps, but im confused and the boxes are too small.
In response to Jp
He wants the alert box to appear on screen, something like of which Acheron's Awakening.




Correct, Pharaoh?
In response to Cheetoz
Cheetoz wrote:
He wants the alert box to appear on screen, something like of which Acheron's Awakening.




Correct, Pharaoh?

yes, but... hoy I do this?
In response to Pharaoh Atem
people, i compiled my game with some new thinks, and when i pressed ctrl+R, appeared this on the dream seeker: BYOND Error: bad world
Connection failed.

Whadda i do now?My BYOND version its 348.905 and i need to finish this update until sunday!!Help please!
In response to Pharaoh Atem
Pharaoh Atem wrote:
people, i compiled my game with some new thinks, and when i pressed ctrl+R, appeared this on the dream seeker: BYOND Error: bad world
Connection failed.

Whadda i do now?My BYOND version its 348.905 and i need to finish this update until sunday!!Help please!

Ok, bug fixed, but... How i make these graphical alert things???
In response to Pharaoh Atem
Look up information on huds, what you want is a form of a hud.
In response to Scoobert
Scoobert wrote:
Look up information on huds, what you want is a form of a hud.

the maximum that i've found its a Screen Messages demo, but i want make the messages appearing in the middle of the usr's screen and with an edge.
In response to Pharaoh Atem
Ppl, i've modified the "MapText" demo, but i have some problems:

#define FILE_DIR .

proc
MapText(To, Text as text, turf/Loc, Layer = FLY_LAYER, line = 0, offset = 0, charset = 'charset.dmi')
if(!Loc || !Text) return
if(offset > 3)
world.log << "Invalid offset in MapText:\n\t\
To:
[To] Text:[Text] Loc:[Loc]\n\t\
line:
[line] offset:[offset]"
return
var
Image
list/Images = list()
len = lentext(Text)
obj/O = new()
if(line) line = 4
O.icon = charset
O.layer = Layer
for(var/position = 1, position <= len,) // no increment here because I do it in the next line
O.icon_state = "[copytext(Text, position, ++position)][offset+line]" // increment position here to avoid redundant math operations
Image = image(O,Loc)
Images += Image
To << Image
if(++offset > 3)
offset = 0
Loc = locate(Loc.x+1,Loc.y, Loc.z)
if(!Loc) break
return Images

OverlayText(Text as text, turf/Loc, Layer = FLY_LAYER, line = 0, offset = 0, charset = 'charset.dmi')
if(!Loc || !Text) return
if(offset > 3)
world.log << "Invalid offset in MapText:\n\t\
Text:
[Text] Loc:[Loc]\n\t\
line:
[line] offset:[offset]"
return 0
var
len = lentext(Text)
obj/O = new()
if(line) line = 4
O.icon = charset
O.layer = Layer
for(var/position = 1, position <= len,) // no increment here because I do it in the next line
O.icon_state = "[copytext(Text, position, ++position)][offset+line]" // increment position here to avoid redundant math operations
Loc.overlays += O
if(++offset > 3)
offset = 0
Loc = locate(Loc.x+1,Loc.y, Loc.z)
if(!Loc) break
return 1

MapFrame(To,Left,Right,Top,Bottom,Z, Layer = FLY_LAYER, frame = 'balloon50.dmi')
var
obj/O = new()
Image
list/Images = list()

O.icon = frame
O.layer = Layer
O.icon_state = "tl"
O.screen_loc = "8,10"
Image = image(O,locate(Left,Top,Z))
To << Image
Images += Image

O.icon_state = "tr"
O.screen_loc = "10,10"
Image = image(O,locate(Right,Top,Z))
To << Image
Images += Image

O.icon_state = "bl"
O.screen_loc = "8,8"
Image = image(O,locate(Left,Bottom,Z))
To << Image
Images += Image

O.icon_state = "br"
O.screen_loc = "10,8"
Image = image(O,locate(Right,Bottom,Z))
To << Image
Images += Image

for(var/X = Left + 1, X < Right, ++X)
O.icon_state = "tm"
O.screen_loc = "9,8"
Image = image(O,locate(X,Top,Z))
To << Image
Images += Image

O.icon_state = "bm"
O.screen_loc = "9,10"
Image = image(O,locate(X,Bottom,Z))
To << Image
Images += Image

for(var/Y = Bottom+1, Y < Top, ++Y)
O.icon_state = "cl"
O.screen_loc = "8,9"
Image = image(O,locate(Left,Y,Z))
To << Image
Images += Image

O.icon_state = "cr"
O.screen_loc = "10,9"
Image = image(O,locate(Right,Y,Z))
To << Image
Images += Image

O.icon_state = "cm"
O.screen_loc = "9,9"
Image = image(O,locate(X, Y, Z))
To << Image
Images += Image

return Images


OverlayFrame(Left,Right,Top,Bottom,Z, Layer = FLY_LAYER, frame = 'balloon50.dmi')
var
obj/O = new()
turf/T = locate(Left,Top,Z)

O.icon = frame
O.layer = Layer
O.icon_state = "tl"
O.screen_loc = "8,10"
T.overlays += O

O.icon_state = "tr"
O.screen_loc = "10,10"
T.overlays += O

O.icon_state = "bl"
O.screen_loc = "8,8"
T.overlays += O

O.icon_state = "br"
O.screen_loc = "10,8"
T.overlays += O

for(var/X = Left + 1, X < Right, ++X)
O.icon_state = "tm"
O.screen_loc = "9,10"
T.overlays += O

O.icon_state = "bm"
O.screen_loc = "9,8"
T.overlays += O

for(var/Y = Bottom+1, Y < Top, ++Y)
O.icon_state = "cl"
O.screen_loc = "8,9"
T.overlays += O

O.icon_state = "cr"
O.screen_loc = "10,9"
T.overlays += O

O.icon_state = "cm"
O.screen_loc = "9,9"
T.overlays += O


BalloonText(Text as text, turf/Loc, delay = 5, charset = 'charset.dmi', balloon = 'balloon50.dmi')
if(!Loc || !Text) return
var
Len = lentext(Text)
width
height
Top
Bottom
Left
Right
Z = Loc.z
obj/O = new()
Image
list/Images = list()

// find height and width
if(Len == 0)
height = 0
width = 0
else if(Len < 41)
height = 1
width = 1
if(Len > 41)
Text = copytext(Text,1,106) + "..."
Len = 41

Top = Loc.y + height + 2
if(Top > world.maxy) Top = Loc.y - 1
Bottom = Top - height - 1

Left = Loc.x - round((height/2),1) - 1
if(Left < 1 ) Left = 1
Right = Left + width + 1
if(Right > world.maxx)
Right = world.maxx
Left = Right - width - 1

// draw the balloon
Images = MapFrame(view(Loc), Left, Right, Top, Bottom, Z,, balloon)

// draw the tail
O.icon = balloon
O.layer = FLY_LAYER

// draw the text
width = 6 + 4 * width // width in characters
var high = 0
var turf/Turf = locate(Left,Top,Z)
for(var/Y = 0, Y < ((height+1)*2), Y++)
Images += MapText(view(Loc),copytext(Text,Y*width+1,(Y+1)*width+1),Turf,,high,1,charset)
high = !high
if(high)
Turf = locate(Left,Turf.y-1,Z)

for(var/I in Images)
client.screen += I

spawn(delay)
for(var/I in Images)
del(I)


Errors: loading MapText.dme
MapText.dm:221:error:client.screen:undefined var
MapText.dm:178:Image :warning: variable defined but not used

MapText.dmb - 1 error, 1 warning (double-click on an error to jump to it)



Where are the error?=( Please help me!
In response to Pharaoh Atem
people, i need this really fast, please answer me, im very confused =( =(
In response to Pharaoh Atem
Show us what lines it is, double click the error and it will highlight the line.

-Doh

EDIT: I am guessing that the client.screen error is at the bottom, and it's because there is no client, this is a global proc. I am guessing the person your showing it to is "To", so replace client.screen with To.client.screen
In response to XxDohxX
XxDohxX wrote:
Show us what lines it is, double click the error and it will highlight the line.

-Doh

EDIT: I am guessing that the client.screen error is at the bottom, and it's because there is no client, this is a global proc. I am guessing the person your showing it to is "To", so replace client.screen with To.client.screen

I fixed this errors, and when i tested, it only "says" on the text, no pop-up appears.If someone knows a demo that do that, or knows the code, please help me.
In response to Pharaoh Atem
MapText is far outdated. sd_Text is now available for free and has built in HUD based input. You should get sd_Text version 9 (http://developer.byond.com/hub/Shadowdarke/sd_TextV9) for accurate mouse hits with sd_Input().
In response to Shadowdarke
That's a cool library shadow, thanks for pointing that out. Mind explaining how you would implement that into your own game or did you already do it in the lib.? I didn't read it yet.
In response to Pyro_dragons
The demo shows you some examples of how it works. There is complete documentation included. :)