Movie Implementierung :(
Übersicht

#c0rEDaMagEBetreff: Movie Implementierung :( |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Hallo,
Ich bin zurzeit dabei ein kleines RPG zu programmieren um so BB zu lernen. Jetzt hab ich ein Intro gemacht aber er gibt mir jedes mal einen Memory Access violation an: Code: [AUSKLAPPEN] ;Intro ; OpenMovie ; MovieHeight ; MovieWidth ; MoviePlaying ; DrawMovie Graphics 640,480,16,1 Const WIDTH = 640 Const HEIGHT = 480 SetBuffer BackBuffer() ClsColor 0,0,0 Color 0,255,0 ;movie muss avi / mpeg sein ; Next, open the movie file. Feel free to change this to an AVI or MPEG file. intro=OpenMovie("video/intro.mpeg") If intro=0 Then RuntimeError "Fehler - kann Video nicht laden"" If Not(MoviePlaying(intro)) Then RuntimeError "Fehler - Kann Video nicht abspielen!" w=MovieWidth(640) ; the width of the movie h=MovieHeight(480) ; the height of the movie ; Now set up the starting position and timing variables x=(1); the x position of the movie on screen y=(1) ; the y position of the movie on screen period=100 ; the interval between frames time=MilliSecs() ; the time of the last frame update ; And here's the main loop Repeat ; Wait for the specified period ; GIFs have no timing info, and as such will redraw the next frame on each call to DrawMovie. ; AVIs and MPEGs do have timing info, and as such will redraw the most recent frame on each call to DrawMovie. ; Ergo, this time limiter only has an impact, and is only required for GIFs. Repeat ; do nothing Until MilliSecs()-time>=period time=MilliSecs() ; save the current time for the next frame ; Redraw the screen, by... Cls ; clear the screen DrawMovie intro,x,y,w,h ; draw the movie ; Flip the buffers Flip Until KeyHit(1) ; Escape to exit ; Remove the movie from memory before closing down CloseMovie(intro) Include "Luciana.bb" Ich hab das nach der Command reference gearbeitet als es nicht ging hab ich halt den code kopiert und angepasst -> ging immer noch nicht. Ich verwende Blitz 3d 1.96. lg c0re |
||
Dreamora |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Das Problem sind die nutzung von movieheight / width. Dort must du intro nutzen nicht die grösse des Fensters. | ||
Ihr findet die aktuellen Projekte unter Gayasoft und könnt mich unter @gayasoft auf Twitter erreichen. |
#c0rEDaMagE |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Vielen Dank, allerdings bleibt jetzt der Bildschirm schwarz bis ich Escape drücke. Kann das am Codec(Mpeg 1) liegen?Sound hat das Video nicht da ich das über einen extra Sound start mache um auch im Hauptmenü noch Musik unterlegung zu haben. | ||
$tankY |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Code: [AUSKLAPPEN] Graphics 640,480,16,1
ersetz ma die 16 durch 0, vllt liegt es daran |
||
Dreamora |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
DrawMovie intro,x,y,w,h
Könnte übrigens auch ein problem sein sofern der film grösser ist als das Fenster bzw. x + w grösser ist als das fenster breit bzw. y + h grösser als das fenster hoch |
||
Ihr findet die aktuellen Projekte unter Gayasoft und könnt mich unter @gayasoft auf Twitter erreichen. |
#c0rEDaMagE |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
puh, Vielen Dank ihr beiden es geht zwar ein bisschen langsam aber es geht ![]() EDit: zu früh gefreut jetzt zeigt er bei meinem Hauptmenü nur noch den Input an. Code des Hauptmenüs: Code: [AUSKLAPPEN] Delay 1000
Text 320,280,"Project Luciana" Delay 1000 Text 320,320,"1.Start" Delay 1500 Text 320,340,"2.Ende" mainmenustart$="1" mainmenuende$="2" Locate 320,360 mainmenuchoose$=Input("Wähle: ") If mainmenuchoose$=mainmenuende$ Then End If mainmenuchoose$=mainmenustart$ Then Cls Delay 1500 Text 320,280,"Include des Newgamefiles" Delay 3000 ;Include "startnewgame.bb" ;Goto startnewgame Delay 2000 Else Text 320,550,"False Input Type." Goto mainmenu Delay 10000 EndIf |
||
$tankY |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Code: [AUSKLAPPEN] Delay 1000
Text 320,280,"Project Luciana" Delay 1000 Text 320,320,"1.Start" Delay 1500 Text 320,340,"2.Ende" mainmenustart$="1" ;$ kann man weglassen, verbraucht nur speicher mainmenuende$="2" Locate 320,360 mainmenuchoose$=Input("Wähle: ") If mainmenuchoose$=mainmenuende$ Then End If mainmenuchoose$=mainmenustart$ Then Cls ;Hier loeschst du alles, was du zuvor auf den buffer geschrieben hast Delay 1500 Text 320,280,"Include des Newgamefiles" Delay 3000 ;Include "startnewgame.bb" ;Goto startnewgame Delay 2000 Else Text 320,550,"False Input Type." Goto mainmenu Delay 10000 EndIf Edit: Input ist nicht gut, wenn du graphics benutzt, suche ma nach einer eingabe routine und schau dir das an! Dein Programmierstil ist auch nicht sehr besonders, vllt solltest du dir die deutsch OH downloaden (glaub blitzbase.de) und das tut von robsite nochma anschauen. |
||
![]() |
x-pressive |
![]() Antworten mit Zitat ![]() |
---|---|---|
So viel Code, um ein einfaches Intro abzuspielen? Jessas... das geht auch kompakter:
Code: [AUSKLAPPEN] Movie% = OpenMovie("intro.mpg")
While Movie <> 0 And KeyHit(1) = False And MouseHit(1) = False And KeyHit(57) = False DrawMovie Movie,0,0,800,600 : Flip 1 : If Not MoviePlaying(Movie) Exit Wend If Movie <> 0 Then CloseMovie Movie : Movie = 0 ![]() ![]() |
||
• BLITZ SHOWCASE:
PARTICLE CANDY • PARTICLE CANDY FOR iPHONE • SPRITE CANDY • DON'T GET ANGRY! 2-3 • CLICK CLACK XL |
#c0rEDaMagE |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Vielen dank werde nacher alles ausprobiern.
Wie gesagt bin noch totaler anfänger und das ist halt so geschrieben wie ichs im Moment noch nur kann. Und Movie ist Mpeg4 v2 codiert dürfte auch gehn oder? |
||
Dreamora |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Nur wenn auf dem Zielsystem der Codec vorhanden ist.
Deswegen wurde empfohlen nur VCD / SVCD zu nehmen, das sind standard codecs die eigentlich da sind auf allen systemen. |
||
Ihr findet die aktuellen Projekte unter Gayasoft und könnt mich unter @gayasoft auf Twitter erreichen. |
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group