diff --git a/app/src/gambas3/.lang/.pot b/app/src/gambas3/.lang/.pot index adf16a7a0..30370cd53 100644 --- a/app/src/gambas3/.lang/.pot +++ b/app/src/gambas3/.lang/.pot @@ -371,7 +371,7 @@ msgstr "" #: FGotoLine.form:23 FHelpBrowser.form:60 FIconEditor.class:1413 #: FList.form:121 FMain.class:200 FMakeInstall.class:327 FMenu.form:369 #: FNewConnection.form:244 FNewTable.form:86 FNewTranslation.form:21 -#: FOpenProject.form:167 FOption.class:618 FPasteSpecial.form:77 +#: FOpenProject.form:168 FOption.class:618 FPasteSpecial.form:77 #: FPasteTable.form:107 FPropertyComponent.form:230 FPropertyProject.form:124 #: FReportBorderChooser.form:45 FReportBrushChooser.form:34 #: FReportCoordChooser.form:26 FReportPaddingChooser.form:75 FSave.form:28 @@ -410,7 +410,7 @@ msgstr "" #: FConnectionEditor.class:441 FCreateFile.form:430 FFieldChooser.form:132 #: FFontChooser.form:34 FGotoLine.form:17 FList.form:115 FMain.form:1313 #: FMenu.form:364 FNewConnection.form:238 FNewTable.form:80 -#: FNewTranslation.form:15 FOpenProject.form:161 FPasteSpecial.form:71 +#: FNewTranslation.form:15 FOpenProject.form:162 FPasteSpecial.form:71 #: FPropertyComponent.form:224 FPropertyProject.form:118 #: FReportBorderChooser.form:51 FReportBrushChooser.form:40 #: FReportCoordChooser.form:32 FReportPaddingChooser.form:69 @@ -1093,7 +1093,7 @@ msgstr "" msgid "Title" msgstr "" -#: FCreateProject.form:391 FOpenProject.form:156 +#: FCreateProject.form:391 FOpenProject.form:157 msgid "Open in another window" msgstr "" @@ -2532,15 +2532,15 @@ msgstr "" msgid "Sort history" msgstr "" -#: FMain.class:560 FOpenProject.form:109 FWelcome.form:35 +#: FMain.class:560 FOpenProject.form:110 FWelcome.form:35 msgid "Sort by date" msgstr "" -#: FMain.class:560 FOpenProject.form:118 FWelcome.form:42 +#: FMain.class:560 FOpenProject.form:119 FWelcome.form:42 msgid "Sort by name" msgstr "" -#: FMain.class:560 FOpenProject.form:126 FWelcome.form:48 +#: FMain.class:560 FOpenProject.form:127 FWelcome.form:48 msgid "Sort by path" msgstr "" @@ -3061,7 +3061,7 @@ msgstr "" msgid "Recent" msgstr "" -#: FOpenProject.form:136 FWelcome.class:52 +#: FOpenProject.form:137 FWelcome.class:52 msgid "Examples" msgstr "" diff --git a/app/src/gambas3/.src/Project/FOpenProject.form b/app/src/gambas3/.src/Project/FOpenProject.form index 5f619cbf1..f034f4e27 100644 --- a/app/src/gambas3/.src/Project/FOpenProject.form +++ b/app/src/gambas3/.src/Project/FOpenProject.form @@ -63,6 +63,7 @@ Spacing = True { txtFilter ButtonBox MoveScaled(1,0,24,4) + Foreground = Color.LightForeground Expand = True Picture = Picture["icon:/small/clear"] } diff --git a/examples/examples/Games/StarField/.directory b/examples/examples/Games/StarField/.directory new file mode 100644 index 000000000..06dab1c8a --- /dev/null +++ b/examples/examples/Games/StarField/.directory @@ -0,0 +1,2 @@ +[Desktop Entry] +Icon=./.icon.png diff --git a/examples/examples/Games/StarField/.icon.png b/examples/examples/Games/StarField/.icon.png new file mode 100644 index 000000000..414eb9b8f Binary files /dev/null and b/examples/examples/Games/StarField/.icon.png differ diff --git a/examples/examples/Games/StarField/.project b/examples/examples/Games/StarField/.project new file mode 100644 index 000000000..4148d8ed5 --- /dev/null +++ b/examples/examples/Games/StarField/.project @@ -0,0 +1,12 @@ +# Gambas Project File 3.0 +# Compiled with Gambas 2.99.3 +Title=Star Field +Startup=MMain +Icon=enterprise.png +Version=0.0.3 +Component=gb.image +Component=gb.image.io +Component=gb.sdl +Component=gb.sdl.sound +Authors="Laurent Carlier\nBenoît Minisini" +TabSize=2 diff --git a/examples/examples/Games/StarField/.src/MMain.module b/examples/examples/Games/StarField/.src/MMain.module new file mode 100644 index 000000000..f57ba692e --- /dev/null +++ b/examples/examples/Games/StarField/.src/MMain.module @@ -0,0 +1,81 @@ +' Gambas module file + +Public screen As New Window As "screen" + +' structure pour stocker les coordonnées d'une étoile +' ainsi que sa vitesse +Public Struct Star + x As Integer + y As Integer + speed As Integer +End Struct + +' notre champ étoilé +Private Starfield As New Star[] + +' le logo +Private img As Image +Private rotation As Integer = 0 + +Public Sub Main() + + Dim i As Integer + Dim stars As Star + + Randomize + + ' Ouverture de notre fenêtre, on limite + ' a 60 images par secondes maximum + With screen + .Framerate = 60 + .Resizable = False + .Show() + End With + + img = Image.Load("logo.png") + + ' Remplissons notre champ étoilé + For i = 0 To 100 + Stars = New Star + Stars.x = Int(Rnd(Screen.Width)) + Stars.y = Int(Rnd(screen.Height)) + Stars.speed = Int(Rnd(1, 4)) + Starfield.Push(stars) + Next + +End + +Public Sub screen_draw() + + Dim Stars As Star + + screen.Clear() + + For Each Stars In Starfield + ' Plus une étoile est rapide (proche), plus elle est lumineuse + Draw.ForeColor = &h444444& * Stars.speed + ' Plus elle est proche plus sa trace est longue + Draw.Line(Stars.x, Stars.y, Stars.x + (Stars.speed * 2), stars.y) + Stars.x += Stars.speed + + ' Notre étoile est hors de l'écran + If Stars.x > screen.Width Then + Stars.x = 0 + Stars.y = Int(Rnd(screen.Height)) + Stars.speed = Int(Rnd(1, 4)) + Endif + Next + + ' Attention la couleur affecte aussi les images ! + Draw.ForeColor = &hFFFFFF& + + Draw.Text(Screen.Framerate, 10, Screen.Height - 40) + + ' on applique la rotation et on affiche le logo + Draw.Rotate(rotation) + Draw.Image(img, Screen.Width - 128, Screen.Height - 128) + + ' rotation de 0 a 360 :-) + rotation = (rotation + 1) Mod 360 + +End diff --git a/examples/examples/Games/StarField/.startup b/examples/examples/Games/StarField/.startup new file mode 100644 index 000000000..f4a1a78cb --- /dev/null +++ b/examples/examples/Games/StarField/.startup @@ -0,0 +1,11 @@ +MMain +Star Field +0 +0 +0.0.3 + +gb.image +gb.image.io +gb.sdl +gb.sdl.sound + diff --git a/examples/examples/Games/StarField/enterprise.png b/examples/examples/Games/StarField/enterprise.png new file mode 100644 index 000000000..b05b84a7b Binary files /dev/null and b/examples/examples/Games/StarField/enterprise.png differ diff --git a/examples/examples/Games/StarField/logo.png b/examples/examples/Games/StarField/logo.png new file mode 100644 index 000000000..260c690f9 Binary files /dev/null and b/examples/examples/Games/StarField/logo.png differ