IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Turbo Pascal Discussion :

[TP]Scroll in 320x200


Sujet :

Turbo Pascal

  1. #1
    Nouveau Candidat au Club
    Inscrit en
    Août 2002
    Messages
    2
    Détails du profil
    Informations forums :
    Inscription : Août 2002
    Messages : 2
    Points : 1
    Points
    1
    Par défaut [TP]Scroll in 320x200
    Sorry, but i speak my bad english because i don't know a lot of french .

    Well, i am programming a game in pascal language, a simple program. It is a game type "Sonic the Edheghog", in that i need use the scroll but i don't now how i can do it. The game have the following caracters:

    - 320x200 pixels of resolution
    - 256 colors

    Well, if somebody knows how i can do the scroll that he helps me. If he can, that send me a font code, thanks.

    A friend of Developpez. Jag
    Jag. Un programador de Pascal

  2. #2
    Rédacteur/Modérateur
    Avatar de M.Dlb
    Inscrit en
    Avril 2002
    Messages
    2 464
    Détails du profil
    Informations personnelles :
    Âge : 39

    Informations forums :
    Inscription : Avril 2002
    Messages : 2 464
    Points : 4 311
    Points
    4 311
    Par défaut
    Notre ami espagnol, ca faisait longtemps
    No abla español, so I will explain in english...
    To scroll the window, you can use the subfunctions 06 and 07 of the interrupt 10h ( See more documentations if you need it ). I don't know if it really works because I've never tried it...
    have fun
    a+
    M.Dlb - Modérateur z/OS - Rédacteur et Modérateur Pascal

  3. #3
    Membre émérite

    Homme Profil pro
    Urbaniste
    Inscrit en
    Mars 2002
    Messages
    255
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Aveyron (Midi Pyrénées)

    Informations professionnelles :
    Activité : Urbaniste

    Informations forums :
    Inscription : Mars 2002
    Messages : 255
    Points : 2 717
    Points
    2 717
    Par défaut
    Which sort of scolling do you want ?
    - Vertical scrolling ?
    - Horizontal scrolling ?
    - Background (picture) scrolling ?

    You can use mode 13h to have a 320x200x8 mode :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    asm
      mov ax,0013h
      int 10h
    end;
    To come back to text mode (03h : 80x25x4 text mode) :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    asm
      mov ax,0003h
      int 10h
    end;
    So, in 13h mode, to put a pixel use : 'Mem[$A000: y*320 +x] := coul;' (coul is a 'Byte'), and to get a pixel use : 'coul := Mem[$A000: y*320 +x];',

    Finaly, to do a vertical scrolling (bottom to top) (one step) :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    move (Mem[$A000: 320], Mem[$A000: 0], (320-1)*200);
    Fill (Mem[$A000: 319*320], 0, 320);
    Bye,
    Haypo

  4. #4
    Nouveau Candidat au Club
    Inscrit en
    Août 2002
    Messages
    2
    Détails du profil
    Informations forums :
    Inscription : Août 2002
    Messages : 2
    Points : 1
    Points
    1
    Par défaut Thanks haypo but...
    Ouh! It is very interesant, but i think that it is'nt the thing that i search.

    If you know the game SONIC & KNUCKLES and games of this type, you will know how i search the scroll. That the man moves into the screen in a big screen that moves when the man moves him. do you understand? If the man moves, then the screen moves too. Well, the last procedure that you easy to me can be a posibility option, but i think that it isn't the correct.

    Well, thanks for all
    Jag. Un programador de Pascal

  5. #5
    Membre averti Avatar de charly
    Profil pro
    Inscrit en
    Mars 2002
    Messages
    329
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2002
    Messages : 329
    Points : 358
    Points
    358
    Par défaut
    you should use VBe2 that u can dl on the contribution part , Hdd34 do somethings like that with
    6*8 =42

  6. #6
    Membre émérite

    Homme Profil pro
    Urbaniste
    Inscrit en
    Mars 2002
    Messages
    255
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Aveyron (Midi Pyrénées)

    Informations professionnelles :
    Activité : Urbaniste

    Informations forums :
    Inscription : Mars 2002
    Messages : 255
    Points : 2 717
    Points
    2 717
    Par défaut
    Try this :
    http://pascal.developpez.com/graphisme/Sprite.zip

    You want to move the foreground, no ? For this, two solutions :
    - One very big image : 320 to 5000 pixel width
    - A foreground draw with little image (like 10x10 pixel) : your foreground is a table composed with this littles images. E.g. : if you draw a house (hu hu, nice example), you will have images :
    * ##=wall
    * []=windows
    * ()=door
    * ...

    Your foreground could be :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    ##########
    ##()###[]#
    ##()######
    The code to draw this is very simple ! The function that will draw the foreground should have parameters : current (foreground) x ... It's all !

    If your x if superior to foreground width, you come back to zero :
    x := x mod width;

    Bye,
    Haypo

Discussions similaires

  1. Fenetre sans Scroll Bar
    Par nicolas78986 dans le forum MFC
    Réponses: 15
    Dernier message: 01/06/2007, 03h15
  2. Scroll automatique dans un JTextPane
    Par regbegpower dans le forum Composants
    Réponses: 9
    Dernier message: 11/11/2003, 09h24
  3. le fameux scrolling
    Par tanmieu dans le forum DirectX
    Réponses: 4
    Dernier message: 27/05/2003, 23h25
  4. scrolling vertical et horizontal
    Par myriam dans le forum MFC
    Réponses: 2
    Dernier message: 24/01/2003, 17h06
  5. scroll dans un label
    Par Pretender dans le forum Composants VCL
    Réponses: 9
    Dernier message: 27/09/2002, 17h06

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo