Page 1 sur 2

[Resolu]Menu

Publié : dim. 25/janv./2009 13:10
par guerrier001
Salut , vous allez dire surement pourquoi veut tu faire les chose dure avant les truc facile , je vas vous dire , je trouve les truc dur facile et les truc facile dur comme ce menu que j'essaie de faire je voudrait que quand je clique sur un bouton cela droit faire en sort de demarrer un nouveau fichier pure basic ou demarrer une fenetre graphique pour continuer son programme , cependant il ne fait que ca:

Code : Tout sélectionner

;
InitSprite() : InitKeyboard() ;le demarrage du sprite et du clavier
InitMouse() ;j'ai démarrer la souris
; PureBasic Visual Designer v3.95 build 1485 (PB4Code)


;- Window Constants
;InitKeyboard()

Enumeration
  #window_0
EndEnumeration

;- Gadget Constants
;
Enumeration
  #Text_0
  #Button_0
  #Button_1
  #Button_2
EndEnumeration

;- Fonts
Global FontID1
FontID1 = LoadFont(1, "Algerian", 48)


 OpenWindow(#window_0, 216, 0, 800, 600, "Guerre de la Préhistoire et de l'Histoire",  #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered )
        ;If CreateGadgetList(WindowID(#Editor_0))
      TextGadget(#Text_0, 50, 10, 700, 230, "Guerre de la Préhistoire et de l'Histoire", #PB_Text_Center)
      SetGadgetFont(#Text_0, FontID1)
      ButtonGadget(#Button_0, 310, 280, 210, 60, "COMMENCER")
      ButtonGadget(#Button_1, 310, 460, 210, 60, "QUITTER")
      ButtonGadget(#Button_2, 310, 370, 210, 60, "CONTROLE")
      
    ;EndIf




Repeat
  event = WaitWindowEvent()
Until event = #PB_Event_CloseWindow
Aidé moi s'il vous plait.

Publié : dim. 25/janv./2009 13:55
par Ar-S
Très rapidement fait pour que tu vois en gros.

Code : Tout sélectionner

;{- Enumerations / DataSections
;{ Windows
Enumeration
  #Window_0 : #Button_0 : #Button_1 : #Text_0 : #Text_1 : #Window_1
EndEnumeration
;}
Define.l event, EventWindow, EventGadget, EventType, EventMenu
;}
Procedure OpenWindow_Window_1()
  If OpenWindow(#Window_1, 505, 226, 343, 171, "Window_1", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)
    TextGadget(#Text_1, 55, 30, 210, 40, "COMMENCER", #PB_Text_Center|#SS_CENTERIMAGE)
    ButtonGadget(#Button_1, 90, 90, 140, 35, "quitter")
  EndIf
  Repeat
    event = WaitWindowEvent()
    Select event
      Case #PB_Event_Gadget
        EventGadget = EventGadget()
        EventType = EventType()
        If EventGadget = #Text_0
        ElseIf EventGadget = #Button_1
          End
        EndIf
    EndSelect
  ForEver
EndProcedure

Procedure OpenWindow_Window_0()
  If OpenWindow(#Window_0, 100, 426, 343, 171, "Window_0", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)
    TextGadget(#Text_0, 55, 30, 210, 40, "CONTROL", #PB_Text_Center|#SS_CENTERIMAGE)
    ButtonGadget(#Button_0, 90, 90, 140, 35, "Commencer")
  EndIf
  Repeat
    event = WaitWindowEvent()
    Select event
        ; ///////////////////
      Case #PB_Event_Gadget
        EventGadget = EventGadget()
        EventType = EventType()
        If EventGadget = #Text_0
        ElseIf EventGadget = #Button_0
          OpenWindow_Window_1()
        EndIf
        
        ; ////////////////////////
      Case #PB_Event_CloseWindow
        EventWindow = EventWindow()
        If EventWindow = #Window_0
          CloseWindow(#Window_0)
          Break
        EndIf
    EndSelect
  ForEver
  
EndProcedure

OpenWindow_Window_0()

;
;}
Par contre, essaye de faire attention aux fautes d'orthographe stp, relie toi ! La prog c'est bien mais écrire correctement te servira plus dans la vie...

Publié : dim. 25/janv./2009 13:56
par guerrier001
D'accord , merci.

edit: un petit probleme:

Code : Tout sélectionner

;{- Enumerations / DataSections
;{ Windows
Enumeration
  #Window_0 : #Text_0 : #Button_0 : #Button_1 : #Button_2
EndEnumeration
;}
Define.l event, EventWindow, EventGadget, EventType, EventMenu
;}
;- Fonts
Global FontID1
FontID1 = LoadFont(1, "Algerian", 48) 

Procedure OpenWindow_Window_0()
  If OpenWindow(#window_0, 216, 0, 800, 600, "Guerre de la Préhistoire et de l'Histoire",  #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered ) 
      TextGadget(#Text_0, 50, 10, 700, 230, "Guerre de la Préhistoire et de l'Histoire", #PB_Text_Center)
      SetGadgetFont(#Text_0, FontID1)
      ButtonGadget(#Button_0, 310, 280, 210, 60, "COMMENCER")
      ButtonGadget(#Button_1, 310, 460, 210, 60, "QUITTER")
      ButtonGadget(#Button_2, 310, 370, 210, 60, "CONTROLE")
  EndIf
  Repeat
    event = WaitWindowEvent()
    Select event
        ; ///////////////////
      Case #PB_Event_Gadget
        EventGadget = EventGadget()
        EventType = EventType()
        If EventGadget = #Button_0
IncludeFile "Base_La Guerre Mondiale de la Préhistoire et de l'Histoire.pb"
        EndIf
       
        ; ////////////////////////
      Case #PB_Event_CloseWindow
        EventWindow = EventWindow()
        If EventWindow = #Window_0
          CloseWindow(#Window_0)
          Break
        EndIf
    EndSelect
  ForEver
 
EndProcedure

OpenWindow_Window_0()

;
;} 
il me dit ensuite que on ne peut pas mettre import dans une déclaration , j'essaye de le faire ouvrir du code dreamotion 3D

Publié : dim. 25/janv./2009 19:00
par jbernard13
IncludeFile "Base_La Guerre Mondiale de la Préhistoire et de l'Histoire.pb"
dois se trouver en debut de fichier il me semble .
et etre appeler par une procedure .

Publié : dim. 25/janv./2009 19:08
par guerrier001
Si je fait ce que tu me dit de faire , il va ouvrir directement le fichier sans passer par le menu , aider moi s'il vous plait.

Publié : dim. 25/janv./2009 19:17
par Patrick88
non,

le includefile ne fait que d'ajouter les lignes de code contenue dans le fichier au code en cours, (du temps du gwbasic, c'était la fonction merge)

pour que ton code contenu dans l'include s'exécute, il faut que tu mettes l'appel à la procédure dans l'évent du #gadget0.

Code : Tout sélectionner

If EventGadget = #Button_0
  lance_le_jeu_de_la_guerre()
EndIf 
remarque: pourquoi ne fais tu pas un menu "graphique" avec DM3d ou en sprite 2D, ça serait plus sympa ?

pat

Publié : dim. 25/janv./2009 19:17
par jbernard13
essaye ça :
n'ayant pas le fichier , je peux pas tester si ça marche

Code : Tout sélectionner

Enumeration
  #Main
EndEnumeration

Enumeration
  #Button_0
EndEnumeration

If OpenWindow(#Main,216, 0, 800, 600, "Guerre de la Préhistoire et de l'Histoire",#PB_Window_SystemMenu|#PB_Window_TitleBar|#PB_Window_ScreenCentered)
  SetWindowColor(#Main,RGB(0,0,0))
   ButtonGadget(#Button_0, 310, 280, 210, 60, "COMMENCER") 
 
  EndIf
 
  
  Repeat 
    Select WaitWindowEvent()
      
       Case #PB_Event_Gadget
       Select EventGadget()
        Case #Button_0 : IncludeFile "Base_La Guerre Mondiale de la Préhistoire et de l'Histoire.pb" 
         
          
        EndSelect
        
      Case #PB_Event_CloseWindow
        Quit = #True
    EndSelect
  Until Quit
  End

Publié : dim. 25/janv./2009 19:19
par guerrier001
je n'y a rrive , quoi comment on fait le truc graphique avec dm3d !!!

Publié : dim. 25/janv./2009 19:20
par guerrier001
quand il n'est pas dans une procedure cela ne fonctionne pas !!!

Publié : dim. 25/janv./2009 19:22
par jbernard13
explique toi svp j'ai pas compris

Publié : dim. 25/janv./2009 19:26
par guerrier001
je t'ecrit ce qu'il me dit et tu comprendra :

Ligne 622: Une procedure ne peut pas etre declaree dans un 'If', 'Repeat', 'While' ou 'For'.

Publié : dim. 25/janv./2009 19:29
par guerrier001
Alors que faut t'il fait , ou sinon comment faire un menu avec DM 3D
edit :Pourquoi tu a supprimer ton sujet Pat maintenant on croit j'ai fait du double post !!!

Publié : dim. 25/janv./2009 19:33
par Patrick88
bin en lisant ta réponse jj'ai vu que ce n'était pas ça.

poste tout ton code sur le forum et on regardera ce qui coince.

ensuite, pour le menu, c'était une suggestion,
je ne connais pas dm3d, je ne peux pas t'aider su ce coup là.
pour le menu en sprite2d, ,il me semble qu'il y avait eu un post la dessus dans le temps, faudrait fouiller...

pat

Publié : dim. 25/janv./2009 19:36
par guerrier001
lol ca sert a rien de mettre celui que j'ai inclue car cela le fait a tous les programme utilisant DM 3D j'ai déja essayer.


Menu:

Code : Tout sélectionner

;{- Enumerations / DataSections
;{ Windows
Enumeration
  #Window_0 : #Text_0 : #Button_0 : #Button_1 : #Button_2 : #file_0
EndEnumeration
;}
Define.l event, EventWindow, EventGadget, EventType, EventMenu
;}
;- Fonts
Global FontID1
FontID1 = LoadFont(1, "Algerian", 48) 

Procedure OpenWindow_Window_0()
  If OpenWindow(#window_0, 216, 0, 800, 600, "Guerre de la Préhistoire et de l'Histoire",  #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered ) 
      TextGadget(#Text_0, 50, 10, 700, 230, "Guerre de la Préhistoire et de l'Histoire", #PB_Text_Center)
      SetGadgetFont(#Text_0, FontID1)
      ButtonGadget(#Button_0, 310, 280, 210, 60, "COMMENCER")
      ButtonGadget(#Button_1, 310, 460, 210, 60, "QUITTER")
      ButtonGadget(#Button_2, 310, 370, 210, 60, "CONTROLE")
  EndIf
  Repeat
    event = WaitWindowEvent()
    Select event
        ; ///////////////////
      Case #PB_Event_Gadget
        EventGadget = EventGadget()
        EventType = EventType()
        If EventGadget = #Button_0
OpenFile(#file_0,"Base_La Guerre Mondiale de la Préhistoire et de l'Histoire.pb")
        EndIf
       
        ; ////////////////////////
      Case #PB_Event_CloseWindow
        EventWindow = EventWindow()
        If EventWindow = #Window_0
          CloseWindow(#Window_0)
          Break
        EndIf
    EndSelect
  ForEver
 
EndProcedure
IncludeFile "Base_La Guerre Mondiale de la Préhistoire et de l'Histoire.pb"
OpenWindow_Window_0()
;
;} 

game:

Code : Tout sélectionner

; ------------------------------------------------------------
;   DreaMotion3D
;
;   Exemple     :   Base_game
;   Historique  :
;     18/09/06  00:00    DreaMotion3D Team
;     10/02/07  19:16    TMyke
;
; ------------------------------------------------------------

;-Include Files 
IncludePath "Include\"  :   IncludeFile "dreamotion3d.pbi"

Declare FrameFind( *pframe.D3DXFRAME , *frame.D3DXFRAME)
;-Globales
Global   anglex.f, angley.f, flagXDown.w
Global   mox.f, omx.f, moy.l, omy.l
Global   mFar.f, hh.f


  Global   *camera.CEntity
  Global *texture.CTexture
  Global   *font.CFont
  Global Dim *tiny.CAnimX(30)
  Global Quit.b
   Global  i.l, flag.l
  Global  tab.l=0, *tFrame.D3DXFRAME
  
    DM_InitPhysic()
  ;-Init PB modules
  If InitSprite() = 0 Or InitKeyboard() = 0 Or InitMouse() = 0
    End
  EndIf

  ;-set graphic window 3D
  DM_Graphics3D(800,600, 32,  1, 1)
  ;-load font
  *font = DM_LoadFont( "Tahoma",9 , 0)
  DM_TextColor(*font, 198,198,198,255)
  ;-change directory for media
  SetCurrentDirectory("media/")
 
  ;-Set ambient color
  DM_AmbientLight(250,  250,  250)
  DM_CreateLight(3)


  ; ---------------------------------------
  ;-a little skybox, well here a skydome must be define in first
  ;  
  ; ---------------------------------------
  *sky.CSkySphere = DM_LoadSkySphere("grassenvmap1024.dds", 50)
  DM_TranslateEntity(*sky, 0,-10,0)



  DM_TextureMipLevel( 0 )
  ; ---------------------------------------
       ;-create terrain with terrain engine
  ;     
  ; ---------------------------------------
  ;-create base terrain with heightmap "map.jpg"
  *terrain = DM_CreateTerrain("height113.bmp", 1.5, #False)
  *brush = DM_CreateBrush("terrain")
  DM_LoadTexture("sol113.jpg", DM_GetTexture(*brush))
  DM_LoadTexture("detail3.bmp", DM_GetTexture(*brush,1))
  DM_PaintTerrain(*terrain, *brush )
  DM_FreeBrush(*brush)   
  mFar=800.0


  *tiny  = DM_LoadAnimMesh("bones_all.x")
  DM_ScaleEntity(*tiny, 13,13,13)
  DM_AnimateSpeed(*tiny, 0.01)
  DM_RotateEntity(*tiny, 0,225,0)




  ; ---------------------------------------
            ;-create camera
  ; ---------------------------------------
  *camera   = DM_CreateCamera(800,600,*tiny)
  DM_MoveEntity(*camera, 0,2,4)
  DM_TurnEntity(*camera, 10,180,0)
  DM_CameraClsColor(*camera, 125, 125, 125)
  DM_CameraProjRatio(*camera, 800,600, mFar)


  ; ---------------------------------------
             ;-main loop
  ; ---------------------------------------
  ;-if fullscreen, must do it for keep mouse cursor
  ;-change_curseur( #IDC_ARROW  )
  Repeat
       ExamineKeyboard()
       ExamineMouse()
     ;-if Escape Key, exit
     If KeyboardReleased(#PB_Key_Escape) Or WindowEvent()=#PB_Event_CloseWindow
       Quit=1
     EndIf


   
      h.f = DM_GetTerrainHeight(*terrain, DM_EntityX(*tiny), DM_EntityZ(*tiny))

    If KeyboardPushed(#PB_Key_Down)
        DM_AnimateIndex(*tiny, 1)
      DM_MoveEntity(*tiny, 0,0,4)
      DM_PositionEntity(*tiny, DM_EntityX(*tiny), h+5, DM_EntityZ(*tiny))
    EndIf
          If KeyboardReleased(#PB_Key_Down)
      DM_AnimateIndex(*tiny, 0)
            DM_MoveEntity(*tiny, 0,0,0)
      DM_PositionEntity(*tiny, DM_EntityX(*tiny), h+5, DM_EntityZ(*tiny))
    EndIf
    If KeyboardPushed(#PB_Key_Up)
        DM_AnimateIndex(*tiny, 1)
      DM_MoveEntity(*tiny, 0,0,-4)
      DM_PositionEntity(*tiny, DM_EntityX(*tiny), h+5, DM_EntityZ(*tiny))
    EndIf
      If KeyboardReleased(#PB_Key_Up)
      DM_AnimateIndex(*tiny, 0)
            DM_MoveEntity(*tiny, 0,0,0)
      DM_PositionEntity(*tiny, DM_EntityX(*tiny), h+5, DM_EntityZ(*tiny))
    EndIf
     
  If KeyboardPushed(#PB_Key_Right)
    DM_TurnEntity(*tiny, 0,1,0)
  EndIf

  If KeyboardPushed(#PB_Key_Left)
    DM_TurnEntity(*tiny, 0,-1,0)
  EndIf


        If flagXdown=0
           omx = MouseX()
           omy = MouseY()
           flagXDown=11
        Else
           moy = MouseY()-omy
           angley=(moy/5.0)
           omy= MouseY()
           mox = MouseX()-omx
           anglex=(mox/5.0)
           omx= MouseX()
                     DM_TurnEntity(*tiny, 0,anglex,0)

        EndIf


     ; ---------------
           ;-Render
     ; ---------------
           If flag=0 : DM_UpdateWorld() : EndIf
     DM_BeginScene()
       DM_RenderWorld(*camera)
        ;-draw some informations
        DM_DrawText(*font, 10, 15, "FPS: "+Str(DM_FPS()))    
     DM_EndScene()
  Until Quit=1
  ;-end
  DM_ClearGraphics()
  End
  
  Procedure FrameFind( *pframe.D3DXFRAME , *frame.D3DXFRAME)
  Protected a$
 
  a$=Space(tab)
  Repeat
    *frame = DM_AnimateGetChild(*tiny(0), *pframe, *frame)
    If *frame
      Debug a$+DM_AnimFrameName(*frame)
      tab+3
      FrameFind(*frame, #Null)
    EndIf
  Until *frame=#Null
  tab-3
 
EndProcedure

Publié : lun. 26/janv./2009 12:42
par Patrick88
essaye comme ça.
guerrier001 a écrit :lol ca sert a rien de mettre celui que j'ai inclue car cela le fait a tous les programme utilisant DM 3D j'ai déja essayer.


Menu:

Code : Tout sélectionner

;{- Enumerations / DataSections
;{ Windows
Enumeration
  #Window_0 : #Text_0 : #Button_0 : #Button_1 : #Button_2 : #file_0
EndEnumeration
;}
Define.l event, EventWindow, EventGadget, EventType, EventMenu
;}
;- Fonts
Global FontID1
FontID1 = LoadFont(1, "Algerian", 48) 

IncludeFile "Base_La Guerre Mondiale de la Préhistoire et de l'Histoire.pb"

Procedure OpenWindow_Window_0()
  If OpenWindow(#window_0, 216, 0, 800, 600, "Guerre de la Préhistoire et de l'Histoire",  #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered ) 
      TextGadget(#Text_0, 50, 10, 700, 230, "Guerre de la Préhistoire et de l'Histoire", #PB_Text_Center)
      SetGadgetFont(#Text_0, FontID1)
      ButtonGadget(#Button_0, 310, 280, 210, 60, "COMMENCER")
      ButtonGadget(#Button_1, 310, 460, 210, 60, "QUITTER")
      ButtonGadget(#Button_2, 310, 370, 210, 60, "CONTROLE")
  EndIf
  Repeat
    event = WaitWindowEvent()
    Select event
        ; ///////////////////
      Case #PB_Event_Gadget
        EventGadget = EventGadget()
        EventType = EventType()
        If EventGadget = #Button_0
MON_JEU()
        EndIf
       
        ; ////////////////////////
      Case #PB_Event_CloseWindow
        EventWindow = EventWindow()
        If EventWindow = #Window_0
          CloseWindow(#Window_0)
          Break
        EndIf
    EndSelect
  ForEver
 
EndProcedure

OpenWindow_Window_0()
;
;} 

game:

Code : Tout sélectionner

; ------------------------------------------------------------
;   DreaMotion3D
;
;   Exemple     :   Base_game
;   Historique  :
;     18/09/06  00:00    DreaMotion3D Team
;     10/02/07  19:16    TMyke
;
; ------------------------------------------------------------

;-Include Files 
IncludePath "Include"  :   IncludeFile "dreamotion3d.pbi"

Declare FrameFind( *pframe.D3DXFRAME , *frame.D3DXFRAME)
;-Globales
Global   anglex.f, angley.f, flagXDown.w
Global   mox.f, omx.f, moy.l, omy.l
Global   mFar.f, hh.f


  Global   *camera.CEntity
  Global *texture.CTexture
  Global   *font.CFont
  Global Dim *tiny.CAnimX(30)
  Global Quit.b
   Global  i.l, flag.l
  Global  tab.l=0, *tFrame.D3DXFRAME
  
PROCEDURE MON_JEU()
    DM_InitPhysic()
  ;-Init PB modules
  If InitSprite() = 0 Or InitKeyboard() = 0 Or InitMouse() = 0
    End
  EndIf

  ;-set graphic window 3D
  DM_Graphics3D(800,600, 32,  1, 1)
  ;-load font
  *font = DM_LoadFont( "Tahoma",9 , 0)
  DM_TextColor(*font, 198,198,198,255)
  ;-change directory for media
  SetCurrentDirectory("media/")
 
  ;-Set ambient color
  DM_AmbientLight(250,  250,  250)
  DM_CreateLight(3)


  ; ---------------------------------------
  ;-a little skybox, well here a skydome must be define in first
  ;  
  ; ---------------------------------------
  *sky.CSkySphere = DM_LoadSkySphere("grassenvmap1024.dds", 50)
  DM_TranslateEntity(*sky, 0,-10,0)



  DM_TextureMipLevel( 0 )
  ; ---------------------------------------
       ;-create terrain with terrain engine
  ;     
  ; ---------------------------------------
  ;-create base terrain with heightmap "map.jpg"
  *terrain = DM_CreateTerrain("height113.bmp", 1.5, #False)
  *brush = DM_CreateBrush("terrain")
  DM_LoadTexture("sol113.jpg", DM_GetTexture(*brush))
  DM_LoadTexture("detail3.bmp", DM_GetTexture(*brush,1))
  DM_PaintTerrain(*terrain, *brush )
  DM_FreeBrush(*brush)   
  mFar=800.0


  *tiny  = DM_LoadAnimMesh("bones_all.x")
  DM_ScaleEntity(*tiny, 13,13,13)
  DM_AnimateSpeed(*tiny, 0.01)
  DM_RotateEntity(*tiny, 0,225,0)




  ; ---------------------------------------
            ;-create camera
  ; ---------------------------------------
  *camera   = DM_CreateCamera(800,600,*tiny)
  DM_MoveEntity(*camera, 0,2,4)
  DM_TurnEntity(*camera, 10,180,0)
  DM_CameraClsColor(*camera, 125, 125, 125)
  DM_CameraProjRatio(*camera, 800,600, mFar)


  ; ---------------------------------------
             ;-main loop
  ; ---------------------------------------
  ;-if fullscreen, must do it for keep mouse cursor
  ;-change_curseur( #IDC_ARROW  )
  Repeat
       ExamineKeyboard()
       ExamineMouse()
     ;-if Escape Key, exit
     If KeyboardReleased(#PB_Key_Escape) Or WindowEvent()=#PB_Event_CloseWindow
       Quit=1
     EndIf


   
      h.f = DM_GetTerrainHeight(*terrain, DM_EntityX(*tiny), DM_EntityZ(*tiny))

    If KeyboardPushed(#PB_Key_Down)
        DM_AnimateIndex(*tiny, 1)
      DM_MoveEntity(*tiny, 0,0,4)
      DM_PositionEntity(*tiny, DM_EntityX(*tiny), h+5, DM_EntityZ(*tiny))
    EndIf
          If KeyboardReleased(#PB_Key_Down)
      DM_AnimateIndex(*tiny, 0)
            DM_MoveEntity(*tiny, 0,0,0)
      DM_PositionEntity(*tiny, DM_EntityX(*tiny), h+5, DM_EntityZ(*tiny))
    EndIf
    If KeyboardPushed(#PB_Key_Up)
        DM_AnimateIndex(*tiny, 1)
      DM_MoveEntity(*tiny, 0,0,-4)
      DM_PositionEntity(*tiny, DM_EntityX(*tiny), h+5, DM_EntityZ(*tiny))
    EndIf
      If KeyboardReleased(#PB_Key_Up)
      DM_AnimateIndex(*tiny, 0)
            DM_MoveEntity(*tiny, 0,0,0)
      DM_PositionEntity(*tiny, DM_EntityX(*tiny), h+5, DM_EntityZ(*tiny))
    EndIf
     
  If KeyboardPushed(#PB_Key_Right)
    DM_TurnEntity(*tiny, 0,1,0)
  EndIf

  If KeyboardPushed(#PB_Key_Left)
    DM_TurnEntity(*tiny, 0,-1,0)
  EndIf


        If flagXdown=0
           omx = MouseX()
           omy = MouseY()
           flagXDown=11
        Else
           moy = MouseY()-omy
           angley=(moy/5.0)
           omy= MouseY()
           mox = MouseX()-omx
           anglex=(mox/5.0)
           omx= MouseX()
                     DM_TurnEntity(*tiny, 0,anglex,0)

        EndIf


     ; ---------------
           ;-Render
     ; ---------------
           If flag=0 : DM_UpdateWorld() : EndIf
     DM_BeginScene()
       DM_RenderWorld(*camera)
        ;-draw some informations
        DM_DrawText(*font, 10, 15, "FPS: "+Str(DM_FPS()))    
     DM_EndScene()
  Until Quit=1
  ;-end
  DM_ClearGraphics()
  
ENDPROCEDURE
  
  Procedure FrameFind( *pframe.D3DXFRAME , *frame.D3DXFRAME)
  Protected a$
 
  a$=Space(tab)
  Repeat
    *frame = DM_AnimateGetChild(*tiny(0), *pframe, *frame)
    If *frame
      Debug a$+DM_AnimFrameName(*frame)
      tab+3
      FrameFind(*frame, #Null)
    EndIf
  Until *frame=#Null
  tab-3
 
EndProcedure