Start!

Step1

Step2

Step3

Step4

Step5

Step6

Step7

Step8

Final

Special thanks

Cover


step6: Is this the launcher ?!

You can now display messages, buttons, and images, but you can't lay out the screen, and the screen looks a little uncool. Now let's make some adjustments around that. The new command is



Statement

Parameters

Meaning

pos

X coordinate, Y coordinate

Set the specified coordinates to the current position

color

R, G, B brightness values

Specify text color


It is

. When displaying characters and buttons, they are always arranged vertically in the order in which they are displayed from the upper left of the screen. This doesn't mean that there was no layout. Actually, in HSP, the position where characters and buttons are displayed is the current position. I call it. In word processing software, the position where you start typing characters is called a cursor or caret, and for some reason HSP displays characters and buttons from the current position. You can't see it on the screen, but think of it as having a cursor on the screen that says "I'll put a button or letter from here." After displaying a character or button, the current position automatically moves to the beginning of the next line. That's why, until now, they were lined up vertically. The "pos" instruction changes this current position. For example,


pos

100,50

mes

"Yaho"


If specified as

, the current position will be moved to the position where the X coordinate is 100 and the Y coordinate is 50, and then the message "Yaho" will be displayed. The coordinates of (X, Y) are in 1-dot units with the upper left as (0,0), so in the above example, the 100th dot from the left and the 50th dot from the top are "Yaho". Is displayed. Similarly,


pos

30,200

button

"OK",*hata1


If you write like

, a button with "OK" written at the coordinates (30,200) will be displayed. To do. And one more. Change the current position with the "pos" instruction After that, after displaying characters and buttons, Karen automatically starts the next line. When the to position is changed, align it with the X coordinate specified by the "pos" command. Can be done. in short,


pos

50,80

mes

"1. Today"

mes

"2. Good weather"

mes

"It was 3."


Messages like

are lined up vertically. Now, let's learn another command. It is, for example,


cls

1

color

255,0,0

mes

"Red!"

color

0,0,255

mes

"Blue!"


Use it like this. The "color" command changes the color of the displayed characters. There is a function. It seems difficult because there are 3 parameters, but It is said that the screen of the computer displays three colors, R, G, and B. I don't think it's difficult for those who know that.



color Red brightness value, green brightness value, blue brightness value


Specify the color like this. Up to 16.7 million colors on Windows This is the simplest way to get it out and specify it. The brightness value is how bright the component is. 0 is the most It is dark and 255 is the brightest. How to specify the color If you don't know, just remember the following settings.


color

0

,0

,0

; <-Black

color

0

,0

,255

; <-blue

color

255

,0

,0

; <-red

color

255

,0

,255

; <-purple

color

0

,255

,0

; <-green

color

0

,255

,255

; <-Light blue

color

255

,255

,0

; <-Yellow

color

255

,255

,255

; <-white


Now, when you reach here, display your favorite image file with a free layout. You should now be able to write scripts to select and display. Here's one more command you need to make a launcher. prize.



Statement

Parameters

Meaning

exec

String

Execute the specified program


The launcher is the selected program (application) A program like a menu to run. With the touch of a button It's a Windows notepad or a menu that starts a calculator. vinegar. It is this "exec" instruction that makes this possible. This is HS Call another program (application) from P and start it It is an instruction to go. Easy to use,

exec "notepad"


Just specify the file name like. "" Notepad "" is correct, " "NOTEPAD.EXE" ", but you don't have to bother to write it when it is an EXE file. Notepad is a Windows notepad. "Accessory" guru The application in the loop. I pressed the button and jumped If you put this command first, Notepad will start with the push of a button. The launcher is complete ... And another point of this command is

exec "notepad HSP3.TXT"

Specify the file name with a space after the program name as in By doing so, it will open the specified file. In the above example Automatically open the file "HSP3.TXT" in Notepad Will give you.

You have to be careful about the file name you want to open, such as HSP3.TXT. When you specify, the file is in the same directory as the script file Or it must be in the directory specified in the PATH Uto. The directory specified in the PATH is usually a Windows system. Since it is the directory that contains the system, it is a standard Windows system tool. NOTEPAD.EXE, that is, Notepad can be called properly ... So even if you try to call a tool that you installed later It doesn't automatically search the hard disk, so It's possible that the file can't be found ...

With this instruction, it becomes possible to realize functions that cannot be done by HSP by using an external program. For example, if you want to make a music collection, a movie collection, etc.,

exec "mplayer SAMP.AVI"

If you specify like, you can open and display the AVI video file "SAMP.AVI" in the media player, and

exec "mplayer SAMP.MID"

If you specify as, you can easily play a standard MIDI file called "SAMP.MID". Besides, you can specify any file that can be played by the media player such as mp3 and wma. Since mplayer (media player) and notepad (notepad) are Windows-standard software, they can be started on any Windows, but non-standard software such as MS-WORD, which is not prepared as standard, can be started. If you create a script to start it, it will not work outside of that environment. Be careful when creating scripts that will be distributed to an unspecified number of people.

That's it for this part, with an example of a simple script at the end. Remaster how to use buttons and labels before proceeding.


cls

1

pos

100,50

mes

"Calculator"

mes

"Notepad"

mes

"End"

pos

20,50

button

"CALC",*mkcalc

button

"MEMO",*mkmemo

button

"END",*owari

stop

*mkcalc

exec

"calc"

stop

*mkmemo

exec

"notepad"

stop

*owari

end

ONION software Copyright 1997-2009(c) All rights reserved.