Can the alert box be generalized?

If we could specify the title, and add/specify buttons (similar to Delphi’s message box) it would be great.

  1. it would make for cleaner code
  2. and be more apple UI consistent


@akiva, You can specify the title by adding a second parameter to alert, eg alert(message, title)

I’d really like an [ok]|[cancel] buttons and a return!

@Jordan - Thanks (HAdn’t noticed that).
@Briarfox – I agree… And yes/no/cancel

General Q: If Codea can pop up standard UI dialogs, why can’t we?

Here is my question: Why? Codea is a game engine, and there isn’t much of a use for that. There are many things that are more important to do.

@Zoyt why? The answer could be: because most of us, when we experimented with the great game functions of Codea, had some difficulties because of the lack of such a interactive box. So we had to implement some solution, which took time and distracted us from our main goal. And the results was not very nice nor efficient. So a native alert box with some more options would really be useful. At least for test purposes. Also it doesnt feel so complicated to provide, so it would not distract too much TLL from their roadmap? So why not? Anyway, these requests are just a positive feedback from users, and TLL has always made their choice among customer requests, so if it is not really in their roadmap, they will wisely let this one aside, dont worry!

@Zoyt : what’s easier:

MessageBox(“Do you want to play again”,“Game Over”, YesNo)

to pop up a dialog box – using the standard UI – or roll your own?

UI is THE major factor (after game play dynamics) in game success – more so than graphic quality.

I’d rather call standard UI dialogs, and spend the time I save writing game code, than having to rollmy own every time.

If codea could read something like Windows Resource code (for those of use who remember coding for Windows 15 years ago) it would be a great time saver - and I think raise the bar as to what’s productively possible.

(I’d say have a “resource” tab where dialogs/UI are defined – that’s how windows did it. Simple to work with, simple to modify)

I’m just going to put my opinion out there: I really don’t care if they add it or not, but as far as I can tell, gamers much prefer a pretty, game-themed pause screen, info screen, about screen, etc vs an ugly blue (for now) notification window. It take only, if even, 15 minutes to write a class for dialogs. Anyways, there’s my $.02 cents. I do find the current alert screen GREAT for debugging, and I think that’s what it was meant for.

Does anyone know if it just calls the standard apple pop up or did TLL just model it after the apple one? Mainly I want to know, in iOS 7 will it look like the iOS 7 new pop ups

@JakAttak - It’s a native popup, if that’s what you’re asking. The way I know is that you can’t pull down the notification center from there. If it wasn’t, that’d be one amazing copy of an alert.

@Zoyt thanks that’s what I wanted to know

I have to admit, I’m a hypocrite. I actually do think that being able to hand alerts and get feel back would be useful at certain times. I stand corrected. :">


I will be adding the ability to specify buttons and react to button presses to the alert() api.

Great. Thanks.

Fantactic! Thank you so much!

But I have seen on some webpages in the


A textbox. - Take your UserName

How to create a textbox in the message or tools for example:

Normal Alert:
Report Abuse - A spam a ban - Message sent

Report Abuse - Sure? It could be a ban for you!
Keys: Report! , Cancel

Please do this *-:slight_smile:

And you can design your alert with an class: Hard Way, Wish is ready

If Simeon will add buttons: here my design idea:

alert.buttondesign{("Ok", accept), ("Dismiss", ignore)}
alert("Are you sure to sent this Abuse Report? This could be a ban for you!", "Report Abuse", buttondesign)

function accept()
reportabuse.sendreport() -- Is in a class isn't in here
alert("The Report Abuse has been sent!", "Report Send")

function ignore()
-- Ignoring the message
alert("The Report and it's content has been deleted", "Message deleted")