SetImageFont funktioniert nicht im Vollbild [GELÖST]
Übersicht

![]() |
juse4proBetreff: SetImageFont funktioniert nicht im Vollbild [GELÖST] |
![]() Antworten mit Zitat ![]() |
---|---|---|
Hi,
ich hoffe mein Problem ist im Titel enthalten. Folgendes Szenario: Ich hab ne kleine, feine GUI. Die funktioniert im Fenstermodus einfach klasse. Wenn ich bei Graphics nun als 3. Parameter 16 oder 32 angebe funktioniert SetImageFont nichtmehr und meint, dass die geladene Schriftart ungültig ist. (Obwohl mein Debug-Print da was anderes sagt) Ich verstehs nicht. Hab auf verschiedenen Auflösungen und Farbtiefen getestet. Habe sogar verschiedene Schriftarten genommen. Immer das selbe. Vlt. Hoffe ihr könnt mir helfen. ![]() |
||
Portfolio |LinkedIn |XING |
- Zuletzt bearbeitet von juse4pro am So, Jan 02, 2011 20:34, insgesamt einmal bearbeitet
![]() |
Thunder |
![]() Antworten mit Zitat ![]() |
---|---|---|
Probier das Programm Mal mit allen drei Treibern aus. Nach deiner Beschreibung nehme ich an, dass es am neuen Direct3D9 Treiber liegt.
BlitzMax: [AUSKLAPPEN] SetGraphicsDriver D3D7Max2DDriver() ...wären daher interessant. mfg Thunder |
||
Meine Sachen: https://bitbucket.org/chtisgit https://github.com/chtisgit |
![]() |
juse4pro |
![]() Antworten mit Zitat ![]() |
---|---|---|
Ich hatte vorerst garkeinen (weis nicht was default ist... glaube DX7)... Dann D3D9
Und OpenGL lass ich die Finger von. (Bei CS2D funktioniert es ja, also wundert mich das schon (sowohl in DX als auch in OpenGL)) |
||
Portfolio |LinkedIn |XING |
![]() |
Thunder |
![]() Antworten mit Zitat ![]() |
---|---|---|
Standard ist bei den BlitzMax-Versionen, bei denen der D3D9 Treiber dabei ist, jener. Daher wäre es interessant gewesen, ob die anderen Treiber das genauso darstellen. | ||
Meine Sachen: https://bitbucket.org/chtisgit https://github.com/chtisgit |
![]() |
juse4pro |
![]() Antworten mit Zitat ![]() |
---|---|---|
Was meinst du mit darstellen? Leider ist das ja nicht der Fall ![]() Und es funktioniert mit keinem der 3 Treiber @Code: [AUSKLAPPEN] TGui.font_normal = LoadImageFont(gfx_dir+"\verdana.ttf", 12)
Print (Not TGui.font_normal = Null) SetImageFont(TGui.font_normal) |
||
Portfolio |LinkedIn |XING |
![]() |
XeresModerator |
![]() Antworten mit Zitat ![]() |
---|---|---|
Bei mir wird kein Grafikobjekt erzeugt (für depth <> 0), dann kann DrawText auch nichts werden...
BlitzMax: [AUSKLAPPEN] SuperStrict Komisch... |
||
Win10 Prof.(x64)/Ubuntu 16.04|CPU 4x3Ghz (Intel i5-4590S)|RAM 8 GB|GeForce GTX 960
Wie man Fragen richtig stellt || "Es geht nicht" || Video-Tutorial: Sinus & Cosinus THERE IS NO FAIR. THERE IS NO JUSTICE. THERE IS JUST ME. (Death, Discworld) |
![]() |
Thunder |
![]() Antworten mit Zitat ![]() |
---|---|---|
@Xeres: Nimm Mal eine Standardauflösung, 800x600 oder 1024x767 ...
Dann funktioniert es. Edit: Bei mir funktioniert das Szenario mit allen gültigen Werten für Depth und allen drei Treibern. Geprüft mit Courier. |
||
Meine Sachen: https://bitbucket.org/chtisgit https://github.com/chtisgit |
![]() |
XeresModerator |
![]() Antworten mit Zitat ![]() |
---|---|---|
Achja, Blitzmax schaltet ja in den Vollbildmodus... ![]() |
||
Win10 Prof.(x64)/Ubuntu 16.04|CPU 4x3Ghz (Intel i5-4590S)|RAM 8 GB|GeForce GTX 960
Wie man Fragen richtig stellt || "Es geht nicht" || Video-Tutorial: Sinus & Cosinus THERE IS NO FAIR. THERE IS NO JUSTICE. THERE IS JUST ME. (Death, Discworld) |
![]() |
juse4pro |
![]() Antworten mit Zitat ![]() |
---|---|---|
ich wollt' euch das nicht antun, aber hier:
Code: [AUSKLAPPEN] 'gui.bmx
Rem Autor: Dustin Paasch Information: GUI Modul für den Apace-Online-Shooter Copyright: Copyright 2010 by Dustin Paasch EndRem SuperStrict Global GUI_COLOR:Byte[] = [Byte(108),Byte(108),Byte(150)] 'Const GUI_COLOR:Byte[0] = 128 'Const GUI_COLOR:Byte[1] = 128 'Const GUI_COLOR:Byte[2] = 170 Const WINDOW_CLOSE:Byte = %00000001 Const WINDOW_MOVABLE:Byte = %00000010 Const POINTER_NORMAL:Byte = 0 Const POINTER_NO:Byte = 1 Type TGui Global element_list:TList Global pressed_button:TGuiButton Global mx:Int, my:Int, mbuffer1:Byte, mbuffer2:Byte, pointer:Byte Global image_window:TImage, image_button:TImage, image_pointer:TImage Global font_normal:TImageFont Function Init(gfx_dir:String = "gui_gfx") TGui.element_list = New TList TGui.image_window = LoadImage(gfx_dir+"\window.png") TGui.image_button = LoadAnimImage(gfx_dir+"\button.png", 16, 16, 0, 3) TGui.image_pointer = LoadAnimImage(gfx_dir+"\mouse.png", 12, 14, 0, 4) TGui.font_normal = LoadImageFont(gfx_dir+"\verdana.ttf", 12) Print (Not TGui.font_normal = Null) SetImageFont(TGui.font_normal) SetBlend(ALPHABLEND) HideMouse() EndFunction Function Update() TGui.pressed_button = Null TGui.mbuffer2 = TGui.mbuffer1 TGui.mbuffer1 = MouseDown(1) TGui.mx = MouseX() TGui.my = MouseY() TGui.pointer = POINTER_NORMAL For Local element:TGuiWindow = EachIn TGui.element_list element.Draw() element.Update() Next SetColor(255, 255, 255) DrawImage(TGui.image_pointer, TGui.mx, TGui.my, TGui.pointer) EndFunction Function PointerTouch:Byte(x:Int, y:Int, sx:Short, sy:Short) If TGui.mx>=x And TGui.mx<x+sx And TGui.my>=y And TGui.my<y+sy Return(True) EndIf Return(False) EndFunction EndType Type TGuiWindow Field x:Int, y:Int, sx:Short, sy:Short, title:String, sf_x:Float, sf_y:Float, list:TList, movable:Byte, close:TGuiButton Function Create:TGuiWindow(title:String, x:Int, y:Int, sx:Short, sy:Short, flags:Byte = WINDOW_CLOSE|WINDOW_MOVABLE) Local tmp:TGuiWindow = New TGuiWindow TGui.element_list.AddLast(tmp) tmp.list = New TList tmp.title = title tmp.x = x tmp.y = y tmp.sx = sx tmp.sy = sy tmp.sf_x = tmp.sx/128.0 tmp.sf_y = tmp.sy/128.0 tmp.movable = False If flags & WINDOW_MOVABLE = WINDOW_MOVABLE Then tmp.movable = True If flags & WINDOW_CLOSE = WINDOW_CLOSE Then tmp.close = TGuiButton.Create(tmp, "X", tmp.sx-18, 2, 16) Return(tmp) EndFunction Method Draw() SetColor(255, 255, 255) SetScale(Self.sf_x, Self.sf_y) DrawImage(TGui.image_window, Self.x, Self.y) SetScale(1.0, 1.0) DrawText(Self.title+" "+Self.movable, Self.x+2, Self.y+2) EndMethod Method Update() For Local element:TGuiButton = EachIn Self.list element.Draw() element.Update() Next If Self.close And TGui.pressed_button = Self.close Then Self.Free() EndMethod Method Free() TGui.element_list.Remove(Self) EndMethod EndType Type TGuiButton Field parent:TGuiWindow, x:Short, y:Short, length:Float, title:String, active:Byte, status:Byte Function Create:TGuiButton(parent:TGuiWindow, title:String, x:Short, y:Short, length:Short = 96, active:Byte = True) Local tmp:TGuiButton = New TGuiButton parent.list.AddLast(tmp) tmp.parent = parent tmp.x = x tmp.y = y tmp.title = title tmp.length = length/16.0 tmp.active = active Return(tmp) EndFunction Method Draw() Local x:Int = Self.parent.x+Self.x, y:Int = Self.parent.y+Self.y, c:Byte = 127 + Self.active*128 SetColor(c, c, c) SetScale(Self.length, 1.0) DrawImage(TGui.image_button, x, y, Self.status) SetScale(1.0, 1.0) SetColor(GUI_COLOR[0], GUI_COLOR[1], GUI_COLOR[2]) DrawRect(x, y-1, Self.length*16, 1) DrawRect(x-1, y, 1, 16) DrawRect(x+Self.length*16, y, 1, 16) DrawRect(x, y+16, Self.length*16, 1) SetColor(c, c, c) DrawText(Self.title, x+4, y) EndMethod Method Update() Self.status = 0 If Self.active If TGui.PointerTouch(Self.parent.x+Self.x, Self.parent.y+Self.y, Self.length*16.0, 16) Self.status = 1 If TGui.mbuffer2=True Self.status = 2 If TGui.mbuffer1=False Then TGui.pressed_button = Self EndIf EndIf EndIf EndMethod EndType Graphics 640,480,16,50 SetGraphicsDriver( D3D9Max2DDriver() ) TGui.Init() Local w:TGuiWindow = TGuiWindow.Create("Testfenster",10,10,600,400) TGuiButton.Create(w, "Ok", 10, 180, 96, True) TGuiButton.Create(w, "Nein Mann!", 300-106, 180, 96, True) Local timer:TTimer = CreateTimer(50) While Not AppTerminate() TGui.Update() Flip(0);Cls;WaitTimer(timer) Wend Vlt. liegts an was anderem... Sowohl als Arial als auch Verdana funktionieren nicht! (Welche aber bei Cs2D funktionieren. Also muss ein Problem in meinem Code sein, ich hab aber nicht den leisensten Schimmer wo das sein könnte...) |
||
Portfolio |LinkedIn |XING |
![]() |
Hummelpups |
![]() Antworten mit Zitat ![]() |
---|---|---|
man sollte den graphicstreiber eventuell setzen BEVOR man
ein grafikfenster initialisiert? ![]() |
||
blucode - webdesign - Ressource - NetzwerkSim
BlitzBasic 2D - BlitzMax - MaxGUI - Monkey - BlitzPlus |
![]() |
Thunder |
![]() Antworten mit Zitat ![]() |
---|---|---|
Ich möchte davor warnen, das Programm ohne Modifikation im Debugmodus auf schwachen PCs auszuführen!
Es hat meinen PC zweimal ins Jenseits befördert. Kein Hardwareinput (nicht der Powerbutton, nicht die Maus, nicht die Tastatur (Windows+D, Windows+R, Strg+Alt+Entf ...)) haben reagiert. Wichtig! - 50 Hz unterstützt nicht jeder Bildschirm - Appterminate hat im Vollbildmodus keinen Sinn (daher Endlosschleife) - Probier jetzt doch endlich die anderen Grafiktreiber und zwar vor Graphics mfg Thunder |
||
Meine Sachen: https://bitbucket.org/chtisgit https://github.com/chtisgit |
![]() |
juse4pro |
![]() Antworten mit Zitat ![]() |
---|---|---|
Ok davor ist sinnvoller... ![]() Und das mit dem Fullscreen... Ja da kommt noch nen ESC-Exit rein, sorry ![]() Aber es hat auch schon nicht funktioniert, als ich einfach garkeinen Treiber gesetzt habe (Ausserdem funktioniert es auch so, aber nur im Fenstermodus) EDIT: Funktioniert nicht, auch wenn es davor steht... |
||
Portfolio |LinkedIn |XING |
![]() |
DaysShadow |
![]() Antworten mit Zitat ![]() |
---|---|---|
Lad doch einfach mal ein Paket mit Grafiken und Code hoch, damit man es einfach kompilieren kann. | ||
Blessed is the mind too small for doubt |
![]() |
juse4pro |
![]() Antworten mit Zitat ![]() |
---|---|---|
Hmm, wäre wohl die beste Lösung... ![]() https://www.blitzforum.de/upload/file.php?id=10095 |
||
Portfolio |LinkedIn |XING |
![]() |
DaysShadow |
![]() Antworten mit Zitat ![]() |
---|---|---|
Also bei mir funktionieren die Fonts, sowohl verdana als auch arial oder sonstige Schriftarten ohne Veränderungen des Codes...hm.
Probier mal einfach nur einen Font zu laden und dann text zu zeichnen, gehts da? |
||
Blessed is the mind too small for doubt |
![]() |
juse4pro |
![]() Antworten mit Zitat ![]() |
---|---|---|
Es geht bei dir im Vollbild? hää?
Ich verstehe nicht ganz was du meinst... Ich lade doch eine Font.. Und zeichne Text. Achja: wenn ich setfont wegnehme, dann gibts den selben Fehler bei SetBlend |
||
Portfolio |LinkedIn |XING |
![]() |
DaysShadow |
![]() Antworten mit Zitat ![]() |
---|---|---|
Ich meine sowas.
Und ja es geht im Vollbild bei mir. BlitzMax: [AUSKLAPPEN] SuperStrict Isolierung des Problems, so mache ich das jedenfalls wenn ich Probleme habe mit meinem Code. Problem isolieren, schauen ob es geht, wenn ja ist es gut, denn dann liegt der Fehler anderswo. Ist deine BMaxversion aktuell? Grafiktreiber aktuell? Nicht irgendwo in den modulen rumgepfuscht oder rumpfuschen lassen? |
||
Blessed is the mind too small for doubt |
![]() |
juse4pro |
![]() Antworten mit Zitat ![]() |
---|---|---|
Module sind auf Installations-Status...
Version ist aktuell... (1.41) Grafiktreiber ist aktuell... Und: Bei CS2D funzt es ja auch... hab die Font mal dahin kopiert. Ich check das Problem nicht... PS: Dein Code funzt bei mir auch. *** EDIT *** Yeah! Es lag daran, dass ich auf 50 Hz gestellt hatte! Sorry, dass ich das so gekonnt ignoriert habe. Jetzt funktioniert es! Danke an alle! ![]() |
||
Portfolio |LinkedIn |XING |
![]() |
DaysShadow |
![]() Antworten mit Zitat ![]() |
---|---|---|
Oh mann -_- xD | ||
Blessed is the mind too small for doubt |
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group