Hello world/Graphical: Difference between revisions
Content added Content deleted
imported>Ahk user (Added example Autohotkey V2) |
CtN-Dev777 (talk | contribs) (Add example for Crystal programming language) |
||
Line 1,256: | Line 1,256: | ||
RETURN |
RETURN |
||
</syntaxhighlight> |
|||
=={{header|Crystal}}== |
|||
{{libheader|CrSFML}} |
|||
<syntaxhighlight lang="crystal"> |
|||
require "crsfml" |
|||
window = SF::RenderWindow.new(SF::VideoMode.new(800, 600), "Hello world/Graphical") |
|||
font = SF::Font.from_file("DejaVuSerif-Bold.ttf") |
|||
text = SF::Text.new |
|||
text.font = font |
|||
text.string = "Goodbye, world!" |
|||
text.character_size = 24 |
|||
text.color = SF::Color::Black |
|||
while window.open? |
|||
while event = window.poll_event |
|||
if event.is_a? SF::Event::Closed |
|||
window.close |
|||
end |
|||
end |
|||
window.clear(SF::Color::White) |
|||
window.draw(text) |
|||
window.display |
|||
end |
|||
</syntaxhighlight> |
</syntaxhighlight> |
||