schreibskript
Übersicht
BlitzBasic
Beginners-Corner|
|
WEBLinkBetreff: schreibskript |
Antworten mit Zitat |
|---|---|---|
|
Jo, cih suche ein code der Input ersetzt.
MfG |
||
|
|
SchnittlauchUnkrautBetreff: Re: schreibskript |
Antworten mit Zitat |
|---|---|---|
| Versuch es mal mit getkey() | ||
| Ich wars nicht. | ||
antome!!! gesperrt !!! |
Antworten mit Zitat |
|
|---|---|---|
|
Im AnimB3D Quellcode ist eine Function drin, ich habe sie aus dem offiziellen und etwas verändert.
Ist auch als Text im Codearchiv hier zu finden. |
||
| antome | ||
|
|
BlitzcoderNewsposter |
Antworten mit Zitat |
|---|---|---|
|
Sowas kann man sich sehr leicht selber schreiben. Schau dir die Befehler getkey() Chr() Asc() etc an.
MfG Blitzcoder |
||
|
P4 3 Ghz@3,55Ghz|GF 6600GT 256MB|Samsung 80GB | 2x Samsung 160GB|2048MB DDR-400 RAM|6 Mbit Flatrate | Logitech G15 | Samsung 225BW-TFT | Ubuntu Gutsy Linux | Windows Vista | Desktop | Blog | CollIDE | Worklog
________________ |°°°°°°°°°°°°°°||'""|""\__,_ |______________ ||__ |__|__ |) |(@) |(@)"""**|(@)(@)****|(@) |
||
|
|
WEBLink |
Antworten mit Zitat |
|---|---|---|
| Mhh, wie meinen? | ||
antome!!! gesperrt !!! |
Antworten mit Zitat |
|
|---|---|---|
| Falsche Funktion kann gelöscht werden | ||
| antome | ||
- Zuletzt bearbeitet von antome am Mo, Sep 18, 2006 22:18, insgesamt einmal bearbeitet
|
|
WEBLink |
Antworten mit Zitat |
|---|---|---|
|
Bearbeitet dies nicht ein Text?
Mir reicht es schon wenn einer erstellt wird. |
||
antome!!! gesperrt !!! |
Antworten mit Zitat |
|
|---|---|---|
|
War die falsche Funktion, hier eine kleine Demo
ist zwar etwas groß aber funktioniert. Taste 1 drücken und dann kannst du Text eingeben Code: [AUSKLAPPEN] Graphics3D 800,600,0,2 Camera = CreateCamera() light = CreateLight() While Not KeyDown(1) If KeyDown(2) Then t$ = GetInput$(20,20,"Test ",50) RenderWorld Text 10,100,t$ Flip Wend ;Based on Input Function from the Blitz codesection by Russell Function GetInput$(x,y,sPrompt$,iMaxLength = 10,xtest = 0,sFilter$ = "/all") FlushKeys iFlashInterval = 300 ; The blinking cursor speed If Lower$(sFilter$) = "/123" Then sFilter$ = "0123456789." ; All the numbers If Lower$(sFilter$) = "/abc" Then sFilter$ = "abcdefghijklmnopqrstuvwxyz" ; All the letters iTotalWidth = StringWidth(sPrompt$) + (iMaxLength * FontWidth()) iTotalHeight = FontHeight() hTextBuffer = CreateImage(iTotalWidth,iTotalHeight) ; Where the text will be drawn before blitting to the backbuffer() hCleanCopy = CreateImage(iTotalWidth,iTotalHeight) ; Will hold a clean copy of the backbuffer (not the whole thing) MaskImage hTextBuffer,255,0,255 ; Make the text background transparent so we can show text with BG showing SetBuffer ImageBuffer(hTextBuffer) ; We're going to draw to the text buffer ClsColor 255,0,255 ; Temporarily make the cls color the transparent color (magenta) Cls ; Now clear to magenta ; Foreground (text) will be drawn in the current color CopyRect x,y,iTotalWidth,iTotalHeight,0,0,BackBuffer(),ImageBuffer(hCleanCopy) ; Save a clean copy of the back buffer where the ; text is going to be SetBuffer BackBuffer() Repeat ; Blinking cursor code ******************************************************************************************************* iCurrentTime = MilliSecs() If bFlash = True Then If (iCurrentTime - iOldFlashTime) >= iFlashInterval Then bFlash = False iOldFlashTime = MilliSecs() EndIf Else If (iCurrentTime - iOldFlashTime) >= iFlashInterval Then bFlash = True iOldFlashTime = MilliSecs() EndIf EndIf ; Input starts here ********************************************************************************************************** iKeyPressed = GetKey() If iKeyPressed = 13 Then sKeyPressed$ = "" Else sKeyPressed$ = Chr$(iKeyPressed) EndIf ; IF the key passes, add it to the total ************************************************************************************* If iKeyPressed Then If (sFilter$ = "/all") Or (sFilter$ = "") Or (Instr(sFilter$,sKeyPressed$) > 0) Then ; "all" does not filter any keys out If Len(sTotal$) < iMaxLength Then sTotal$ = sTotal$ + sKeyPressed$ ; Add it to the total string IF it passes iNumDigits = iNumDigits + 1 EndIf EndIf EndIf ; IF backspace was pressed, delete the last character from the total and update the number of digits ************************* If KeyDown(14) And iNumDigits > 0 Then sTotal$ = Left$(sTotal$,iNumDigits - 1) iNumDigits = iNumDigits - 1 Delay 50 EndIf ; Draw the clean background and then the text on the backbuffer() ************************************************************ DrawBlock hCleanCopy,x,y ; Draw the cursor IF enough time has passed (change iFlashInterval for different speeds) ************************************* If Len(sTotal$) = iMaxLength Then rx = StringWidth(sPrompt$ + sTotal$) - StringWidth(Right$(sTotal$,1)) rw = StringWidth(Right$(sTotal$,1)) Else rx = StringWidth(sPrompt$) +StringWidth(sTotal$); (Len(sTotal$) * FontWidth()) rw = FontWidth() EndIf UpdateWorld RenderWorld If bFlash = True Then Text x,y,sPrompt$ + sTotal$ Rect x + rx,y,rw/6,FontHeight(),True Else Text x,y,sPrompt$ + sTotal$ EndIf Flip Until iKeyPressed = 13 ; This is the 'return/enter' key ClsColor 0,0,0 ; Reset back to black Return sTotal$ End Function |
||
|
|
WEBLink |
Antworten mit Zitat |
|---|---|---|
| Hey ich danke dir das müsste eigentlich gehen | ||
|
|
WEBLink |
Antworten mit Zitat |
|---|---|---|
| Schade das skript hält das Programm auch an | ||
|
|
PowerProgrammer |
Antworten mit Zitat |
|---|---|---|
|
musste wohl etwas umprogrammieren |
||
| www.xairro.com Alles für Webmaster und Programmierer! Es gibt mehr als bloß einen Counter! | ||
|
|
BladeRunnerModerator |
Antworten mit Zitat |
|---|---|---|
|
1. Keine Doppelposts bitte.
2. Forensuche gibt mehrere Inputroutinen aus |
||
|
Zu Diensten, Bürger.
Intel T2300, 2.5GB DDR 533, Mobility Radeon X1600 Win XP Home SP3 Intel T8400, 4GB DDR3, Nvidia GF9700M GTS Win 7/64 B3D BMax MaxGUI Stolzer Gewinner des BAC#48, #52 & #92 |
||
|
|
BlitzChecker |
Antworten mit Zitat |
|---|---|---|
|
nach weniger als 10 sekunden fosu:
https://www.blitzforum.de/foru...put+ersatz https://www.blitzforum.de/foru...put+ersatz https://www.blitzforum.de/foru...put+ersatz https://www.blitzforum.de/foru...put+ersatz https://www.blitzforum.de/foru...put+ersatz |
||
| www.xairro.com | ||
|
|
PowerProgrammer |
Antworten mit Zitat |
|---|---|---|
| Jo, stand auch schon eine Kleinigkeit im BlitzFAQ, jetzt auch ein paar Links! | ||
| www.xairro.com Alles für Webmaster und Programmierer! Es gibt mehr als bloß einen Counter! | ||
antome!!! gesperrt !!! |
Antworten mit Zitat |
|
|---|---|---|
|
Wenn es dauernd Zeichen abfangen soll brauchts du sowas ähnliches.
Code: [AUSKLAPPEN] While Not KeyDown(1) Cls Code=GetKey () If Code <> 0 Then If Code <> 13 in$ = in$ + Chr$(Code) Else my$ = in$ in$ = "" EndIf EndIf Text 10,10,in$ Text 10,30,my$ Flip Wend |
||
| antome | ||
Übersicht
BlitzBasic
Beginners-Corner
Powered by phpBB © 2001 - 2006, phpBB Group
