@@ -71,7 +71,9 @@ AnchoInicial=ANCHO
71
71
AltoInicial=ALTO
72
72
NroCol = (ANCHO / 20 ) - 4 ' 20 Tamaño figuras, nota guia 6 columnas "B_8_[ "
73
73
'cambie a directX !!! versi anda winpopup
74
+
74
75
ScreenControl SET_DRIVER_NAME, "GDI" ' le da foco a la aplicacion
76
+
75
77
' con Directx nunca tomaelfoco se lodebe dar elusuario
76
78
'nofuncionaningun comndo de winuser.bipara tomar el foco...
77
79
'''''ScreenControl POLL_EVENTS '200
@@ -81,7 +83,9 @@ ScreenControl SET_DRIVER_NAME,"GDI" ' le da foco a la aplicacion
81
83
Dim As String driver
82
84
83
85
ScreenRes ANCHO, ALTO, 32 , 2 , GFX_NO_FRAME Or GFX_HIGH_PRIORITY
86
+
84
87
ScreenControl GET_WINDOW_POS, x0, y0
88
+
85
89
''ScreenControl SET_WINDOW_POS, 10,10
86
90
'ScreenControl 103,"Directx" ' cambio ja
87
91
' CAIRO NO SOPORTA LA �!!! ESO ERA TODO!!!!
@@ -152,7 +156,16 @@ Dim As hWnd hwnd = Cast(hwnd,IhWnd)
152
156
'AppendMenu(exelist, MF_STRING,1,"Uno")
153
157
'AppendMenu(exelist, MF_STRING,2,"Dos")
154
158
Dim comienzo As Integer = 0
159
+ '--FFT FREE FONT- ...HCEDESAPRECER LA APLICCION PORQUERIA
160
+ var Shared ft => FreeType()
161
+
162
+ '' Load a font with FreeType
163
+ Dim Shared as FT_Face ftface
155
164
165
+ FT_New_Face( ft, "Bebaskai.otf" , 0 , @ftface )
166
+
167
+
168
+ '----- -FIN
156
169
157
170
'' --------------- LOOP 1 ---------------
158
171
Do
@@ -165,19 +178,22 @@ ScreenLock()
165
178
166
179
'' Create a cairo drawing context, using the FB screen as surface.
167
180
'' l originalestba mal sizeof(integer ) es mu chico debe ser 4
168
- stride =cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, ANCHO)
181
+ stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, ANCHO)
169
182
170
183
171
184
Var surface = cairo_image_surface_create_for_data(ScreenPtr(), CAIRO_FORMAT_ARGB32, ANCHO, ALTO, stride)
172
185
Var c = cairo_create(surface)
173
186
187
+
188
+
189
+ '' Measure the text, used with SDL_RenderCopy() to draw it without scaling
174
190
175
191
' https://www.cairographics.org/tutorial/
176
192
177
193
178
194
179
195
If comEdit = TRUE Then
180
- ' cairo_set_source_rgba(c, 0.6, 0.5, 0.6, 1)
196
+ ' cairo_set_source_rgba(c, 0.6, 0.5, 0.6, 1)
181
197
cairo_set_source_rgba(c, 0.6 , 0 . 6 , 0 . 7 , 1 )
182
198
Else
183
199
cairo_set_source_rgba c, 0.6 , 0 . 7 , 0 . 8 , 1
@@ -694,6 +710,10 @@ If MultiKey(SC_ESCAPE) Then
694
710
695
711
if MessageBox(hWnd, "¿SEGURO FINALIZA?" , "RollMusic End " , 4 or 64 ) = 6 then
696
712
cairo_destroy(c)
713
+ ' cairo_surface_destroy( surface )
714
+ ' cairo_font_face_destroy( cface )
715
+ FT_Done_Face( ftface )
716
+
697
717
Close 1
698
718
End
699
719
EndIf
@@ -900,6 +920,61 @@ If comEdit = TRUE Then
900
920
EndIf
901
921
' ojo ver q no habia exit do antes !!!!!
902
922
EndIf
923
+ ' ----HELP PRUEBA DE TEXT
924
+ If MultiKey(SC_F1) Then
925
+ ' estopodemos hacer ayuda contextual
926
+ '' Define character range
927
+ Const FIRSTCHAR = 32 , LASTCHAR = 127
928
+
929
+ Const NUMCHARS = (LASTCHAR - FIRSTCHAR) + 1
930
+ Dim As UByte Ptr p, myFont
931
+ Dim As Integer i
932
+
933
+
934
+ '' Create custom font into PUT buffer
935
+
936
+ myFont = ImageCreate(NUMCHARS * 32 , 9 )
937
+
938
+ '' Put font header at start of pixel data
939
+
940
+ #ifndef ImageInfo '' older versions of FB don't have the ImageInfo feature
941
+ p = myFont + IIf(myFont [0 ] = 7 , 32 , 4 )
942
+ # else
943
+ ImageInfo( myFont, , , , , p )
944
+ # endif
945
+
946
+ p [0 ] = 0
947
+ p [1 ] = FIRSTCHAR
948
+ p [2 ] = LASTCHAR
949
+
950
+ '' PUT each character into the font and update width information
951
+ For i = FIRSTCHAR To LASTCHAR
952
+
953
+ '' Here we could define a custom width for each letter, but for simplicity we use
954
+ '' a fixed width of 8 since we are reusing the default font glyphs
955
+ p [3 + i - FIRSTCHAR ] = 12
956
+
957
+ '' Create character onto custom font buffer by drawing using default font
958
+ Draw String myFont, ((i - FIRSTCHAR) * 12 , 1 ), Chr(i), 32 + (i Mod 24 ) + 24
959
+
960
+ Next i
961
+
962
+ '' Now the font buffer is ready; we could save it using BSAVE for later use
963
+ Rem BSave "myfont.bmp" , myFont
964
+
965
+ '' Here we draw a string using the custom font
966
+ 'Draw String (10, 10), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", , myFont
967
+ 'Draw String (10, 26), "abcdefghijklmnopqrstuvwxyz", , myFont
968
+ 'Draw String (66, 58), "Hello world!", , myFont
969
+
970
+ '' Free the font from memory, now we are done with it
971
+ ImageDestroy myFont
972
+
973
+
974
+ Draw String (MOUSEX, MOUSEY), "HOLA SOY tU AYUDA!" , ,myFont
975
+ Draw String (MOUSEX, MOUSEY+ 20 ), "QUE QUERES SABER" , ,myFont
976
+ EndIf
977
+ '
903
978
If comEdit = FALSE Then '''???????????????? veremos para que usarlo
904
979
' para ubicrno enun octava dada
905
980
@@ -1382,6 +1457,10 @@ If (mousex>=(ANCHO-40)) And (mousey <= 16) Then
1382
1457
If MouseButtons And 1 Then
1383
1458
if MessageBox(hWnd, "¿SEGURO FINALIZA? (puede usar Escape tambien)" , "RollMusic End " , 4 or 64 ) = 6 then
1384
1459
cairo_destroy(c)
1460
+ ' cairo_surface_destroy( surface )
1461
+ ' cairo_font_face_destroy( cface )
1462
+ FT_Done_Face( ftface )
1463
+
1385
1464
Close
1386
1465
1387
1466
End
@@ -1425,8 +1504,14 @@ If (mousex>=(ANCHO-40)) And (mousey > 33) And (mousey < 50) Then
1425
1504
1426
1505
'' EndIf
1427
1506
EndIf
1507
+ If MouseButtons And 2 Then
1508
+ '' Width 40,43
1509
+ ayuda= TRUE
1510
+ EndIf
1511
+ If mouseButtons And 1 And ayuda= TRUE Then
1512
+ ayuda= FALSE
1428
1513
1429
-
1514
+ EndIf
1430
1515
If resize = TRUE Then ' <===== MOVER Y REDIMENSIONAR LA PANTALLA NO TAN FACIL
1431
1516
'CLICKEAR CERCA DEL CENTRO Y DRAGAR DERECHA IZQUIERDA ARRIBA ABAJO
1432
1517
m.res = GetMouse( m.x, m.y, m.wheel, m.buttons, m.clip )
@@ -1479,7 +1564,6 @@ EndIf
1479
1564
'' DEBE SEGUIR EJECUTNDO HACIA ABAJO Y CALCULARINDICE VAMOS A MOVER
1480
1565
''ESTEIF AL FINAL
1481
1566
EndIf
1482
-
1483
1567
Exit Do
1484
1568
1485
1569
EndIf ' end (ScreenEvent(@e))
@@ -1505,8 +1589,9 @@ Loop
1505
1589
errorhandler:
1506
1590
Dim er As Integer
1507
1591
er = Err
1508
- Print "Error detected " , er
1509
- Print Erl, Erfn,Ermn,Err
1592
+ Print # 1 , "Error detected " , er
1593
+ Print # 1 ,Erl, Erfn,Ermn,Err
1594
+ Close 1
1510
1595
1511
1596
1512
1597
0 commit comments