Движение графических объектов в QuickBasic - QBasic
Формулировка задачи:
Здравствуйте
Помогите сделать с помощью оператора DRAW чтобы имя "Сергей" двигалось слева направо
Решение задачи: «Движение графических объектов в QuickBasic»
textual
Листинг программы
DECLARE SUB DrawText (Msg AS STRING, X AS INTEGER, Y AS INTEGER, TextColor AS INTEGER, Size AS INTEGER, Angle AS INTEGER) SCREEN 12 DIM SHARED Font(164) AS STRING DIM I AS INTEGER, X AS INTEGER RESTORE FontData FOR I = 0 TO 164 READ Font(I) NEXT I FOR X = 0 TO 640 STEP 5 CLS DrawText "Это мой", X, 175, 9, 3, 45 DrawText "Векторный", X, 205, 11, 4, 0 DrawText "Шрифт", X, 240, 12, 5, -45 FOR j = 1 TO 25 z = SIN(SQR(j)) NEXT j IF INKEY$ <> "" THEN EXIT FOR END IF NEXT X FontData: DATA "BR" DATA "NURUNLBUU3LM+1,+3BF2" DATA "BU4UBRDBD4BR" DATA "BU3NR3BUNR3BEND3BRD3BR2BD2" DATA "BUFEH2ENUNFD5BRBE" DATA "BRRULNDBLE3BLLURDBD4BR2" DATA "BR4HUHLGDFREEBLNDHLHERFGBF3" DATA "BU5DENLBD5BR" DATA "BRBU5GD3FBR" DATA "BU5FD3GBR2" DATA "BU3R2BDH2BD2E2BD4BR" DATA "BU3R2BHD2BD2BR2" DATA "BURGURBF" DATA "BU3R2BD3BR" DATA "URDLBR2" DATA "M+2,-5BD5BR" DATA "BUU3ERFNM-3,+3D3GLHBDBR4" DATA "BU4ED5LR2BR" DATA "BU3UERFDG3R3BR" DATA "BU5R3DGFDGLHBR4BD" DATA "BR3U5G3DR4BF" DATA "BUFREUHL2U2R3BD5BR" DATA "BU2ERFDGLHU3ERFBD4BR" DATA "BU5R3DM-2,+4BR3" DATA "BUUEREHLGFRFDGLHBR4BD" DATA "BUFREU3HLGDFREBD3BR" DATA "URDLBU3URDLBR2BD3" DATA "URGBU3URDLBD3BR2" DATA "BR2M-2,-2M+2,-2BD4BR" DATA "BU2R2BUNL2BD3BR" DATA "M+2,-2M-2,-2BD4BR3" DATA "BU4ERFGDBDDLURBBFBR" DATA "BEBUURDNLEHLGD2FRBR2" DATA "U4ER2D3NL3D2BR" DATA "U5R2FGNL2FDGL2BR4" DATA "BE3BUHLGD3FREBF" DATA "U5R2FD3GL2BR4" DATA "BU5BR3L3D2NR2D3R3BR" DATA "U2NR2U3R3DBD4BR" DATA "BE2RDGLHU3ERFBD4BR" DATA "U3NU2R3NU2D3BR" DATA "RNRU5NLRBD5BR" DATA "BUNUFREU4NL3BD5BR" DATA "U3NU2RNM+2,-2M+2,+3BR" DATA "NU5R3NUBR" DATA "M+1,-5M+1,+5M+1,-5M+1,+5BR" DATA "U5M+3,+5NU5BR" DATA "BUU3ERFD3GLHBDBR4" DATA "U5R2FDGL2BR4BD2" DATA "BUU3ERFD3GLHBRRFBR" DATA "U5R2FDGLNLF2BR" DATA "BUFREUHLHERFBD4BR" DATA "BR2U5BL2BDUR4DBD4BR" DATA "BU5D4FRENU4BF" DATA "BU5M+1,+5RNM+1,-5BR2" DATA "BU5M+1,+5M+1,-5M+1,+5NM+1,-5BR2" DATA "M+3,-5BL3M+3,+5BR" DATA "BRU2NM-1,-3NM+1,-3BF2" DATA "BU4UR3DG3DR3NUBR" DATA "BU5NRD5RBR" DATA "BU5M+2,+5BR" DATA "BU5RD5NLBR" DATA "U3M+1,+2M+1,-2D3BRBU5RDLDRBRBD3" DATA "BDR2BE" DATA "BU5FBD4BR" DATA "BU3EFD2GHERD2BR" DATA "NU5REUHLBF3" DATA "BE3HLGD2FREBF" DATA "BE2BULGDFRNU5BR" DATA "BU2R2EHLGD2FREBF" DATA "BRU2NLNRU2ERBD5BR" DATA "BE2BU2LGDFRNU3DNGBR" DATA "U3NU2RFD2BR" DATA "RNRU3NLBUUBD5BR2" DATA "FEU3NLBUUBD5BR" DATA "U2NU3NE2F2BR" DATA "BUNU4FBR" DATA "U3NUEDND3ED4BR" DATA "U3NUEFD3BR" DATA "BUU2ER1FD2GL1HBDBR4" DATA "U4RFDGLBR3BD" DATA "BE2BU2LGDFRNU3D2BE" DATA "U3NUERBD4BR" DATA "BUFREHLHERFBD3BR" DATA "BRBU5D2NLNRD2FEBF" DATA "BU4D3FRENU3DBR" DATA "BU4M+1,+4NM+1,-4BR2" DATA "BU4M+1,+4M+1,-4M+1,+4NM+1,-4BR2" DATA "M+2,-4BL2M+2,+4BR" DATA "BU4M+1,+2ND2NM+1,-2BF2" DATA "BU3UR2M-2,+4R2NUBR" DATA "BU4BR2GDNLDFBR" DATA "NU4BR" DATA "BU4FDNRDGBR3" DATA "BU2EF2EBD2BR" DATA "BR" DATA "U4ER2D3NL3D2BR" DATA "BU3R2FDGL2U5R3BD5BR" DATA "U5R2FGNL2FDGL2BR4" DATA "U5R3DBD4BR" DATA "BDURM+1,-5RD5NL2RDBE" DATA "BU5BR3L3D2NR2D3R3BR" DATA "U2ER2FD2BL4BU5DFR2EUBL2D5BR3" DATA "BUFREUHEHLGBF4" DATA "NU5M+3,-5D5BR" DATA "NU5M+3,-5ND5BLlBR3BD5" DATA "U3NU2RNM+2,-2M+2,+3BR" DATA "M+2,-5RD5BR" DATA "M+1,-5M+1,+5M+1,-5M+1,+5BR" DATA "U3NU2R3NU2D3BR" DATA "BUU3ERFD3GLHBDBR4" DATA "U5R3D5BR" DATA "U5R2FDGL2BR4BD2" DATA "BE3BUHLGD3FREBF" DATA "BR2U5BL2BDUR4DBD4BR" DATA "BUFREU4BL3D2FR2BD2BR" DATA "BR2U5RFD2GL2HU2ERBR3BD5" DATA "M+3,-5BL3M+3,+5BR" DATA "NU5R2NU5RDBE" DATA "BR3U5BL3D2FR2BD2BR" DATA "NU5R2NU4R2NU5BR" DATA "NU5R2NU4R2NU5RDBE" DATA "BU4URD5R2EUHL2BF3BR" DATA "BU3R2FDGL2U5BR4D5BR" DATA "BU5D5R2EUHL2BF3BR" DATA "BUFREU2NL2UHLGBF4" DATA "U3NU2RUERFD3GLHU3BF4" DATA "E2NRLHUER2D5BR" DATA "BU3EFD2GHERD2BR" DATA "BU2RFGLU3ERBD4BR" DATA "U4RFGNLFGNLBR2" DATA "U4R2DBD3BR" DATA "BDURM+1,-4RD4NL2RDBUBR" DATA "BU2R2EHLGD2FREBF" DATA "UENRHUBR2ND4BR2DGNLFDBR" DATA "BU3ERFGNLFGLHBDBR4" DATA "BU4D4M+2,-4D4BR" DATA "BU4D4M+2,-4BLNUBRD4BR" DATA "U2NU2NE2F2BR" DATA "M+1,-4RD4BR" DATA "M+1,-4M+1,+4M+1,-4M+1,+4BR" DATA "U2NU2R2NU2D2BR" DATA "BUU2ER1FD2GL1HBDBR4" DATA "U4R2D4BR" DATA "U4RFDGLBR3BD" DATA "BE3HLGD2FREBF" DATA "BU3URND4RDBD3BR" DATA "BU4D1FRNU2D1GLBR3" DATA "BR2U4LGDFR2EUHLBD4BR3" DATA "M+2,-4BL2M+2,+4BR" DATA "BU4D4R2NU4RDBE" DATA "BU4D2FRNU3DBR" DATA "NU4RNU4RNU4BR" DATA "NU4RNU4RNU4RDBE" DATA "BU3URD4REUHLBF3" DATA "BU3RFDGLU4BR3D4BR" DATA "NU4REUHLBF3" DATA "BUFREUNLUHLGBF3BR" DATA "U2NU2RUERFD2GLHUBF2BR2" DATA "ENRHUERD4BR" DATA "BU4URDLBF2BD2" DATA "BU2U2R2D2L2BF2BR" DATA "BU2URDLBF2" DATA "BU2RM+1,+2M+1,-5BD5BR" DATA "U5M+2,+5U5RBDRDLNUBDRBD2BR" DATA " BU3BR2DL2U2R2DR4UR2D2L2UBR2BD3BR" DATA "U5R4D5NL4BR" SUB DrawText (Msg AS STRING, X AS INTEGER, Y AS INTEGER, TextColor AS INTEGER, Size AS INTEGER, Angle AS INTEGER) DIM Ln AS INTEGER, N AS INTEGER, I AS INTEGER DIM Mess AS STRING, C AS STRING, S AS STRING, Message AS STRING, A AS STRING FOR N = 1 TO LEN(Msg) I = ASC(MID$(Msg, N, 1)) SELECT CASE I CASE IS < 32 CASE IS < 176 I = I - 32 CASE IS < 224 CASE ELSE I = I - 80 END SELECT Mess = Mess + RTRIM$(Font(I)) NEXT N C = "C" + LTRIM$(RTRIM$(STR$(TextColor))) A = "TA" + LTRIM$(RTRIM$(STR$(Angle))) S = "S" + LTRIM$(RTRIM$(STR$(Size * 4))) Message = C + A + S + Mess + "TA0" PSET (X%, Y%), POINT(X%, Y%) DRAW "X" + VARPTR$(Message$): END SUB
ИИ поможет Вам:
- решить любую задачу по программированию
- объяснить код
- расставить комментарии в коде
- и т.д