Graphic/Sprite Editor window

BASin

The UDG Editor window

The UDG Editor window is available from the Tools menu.

The UDG editor.

One of the most laborious and time-consuming tasks when programming in BASIC is the construction of UDGs for your programs. There is space in memory for up to 21 of these, and in the past they had to be designed on squared paper, and the binary values of the character's lines calculated and entered in using either POKEs or DATA statements.

The UDG editor provides a user-friendly and intuitive graphical interface for creating these graphics.

The window comprises the following areas:

Editing grid

The editing grid.

This area represents, in a large form, the 8×8 character grid used to create one character. You can use the mouse in here to set or un-set pixels in the character. You can select the character you want to work on by clicking in the Character Selection Area, and any changes you make will be shown there as you make them.

A preview of your current character is also displayed at the top right of the grid region.

Character selection area

The character selection area.

This area, to the right of the window, contains a "palette" of characters available. When editing UDGs, this contains 21 graphics.

You can use the left mouse button in a single "click" to send a character to the editing grid. You can also use a "drag and drop" operation on these characters:

  • Use the left mouse button to select a character, and without letting go of the left mouse button, "drag" the character to another character in the selection area to make a copy of that character in that cell.
  • Use the right mouse button to drag a character to exchange it with the character in the destination cell.
  • Use the left mouse button to drag a character to the editing grid, to assign that character to a particular placeholder on the grid.
  • Use the right mouse button to copy a character's data from one character to the editing grid. This is the same as copying between characters on the palette using the left button detailed above.

The Menu strip

The main menu for the UDG/Charset editor allows you to access advanced functions. From left to right, the menu consists of:

The File Menu

  • New

    Clears all the UDGs away and lets you start afresh with a new set.

  • Exit

    Closes the UDG/Charset editor.

  • Exit and discard

    Closes the window and undoes any changes you have made to the UDGs.

  • The Edit Menu

    This menu allows you access to a simple Undo feature, tools for manipulating the grid and individual graphics, and to utilise the clipboard. This clipboard is internal to the UDG editor, and does not give access to the Windows system clipboard.

    • Undo

      Un-Does the last change you made to the current character.

    • Grid

      Gives tools for working with the editing grid.

      • Fill

        Fills the grid with the currently selected graphic in the palette to the right of the window. This can be useful for designing graphics that must tile seamlessly.

      • Clear

        Clears the entire grid, which will also clear all graphics assigned to the grid.

      • Invert

        Inverts every graphic assigned to the grid, which will invert the entire grid.

      • Flip

        Brings up a submenu which allows you to flip the entire grid.

        • Horizontal

          Flips the whole grid left to right. This means that all graphics in the grid will be flipped, and also the data from grid regions at the left of the grid will be moved to the right, and vice-versa.

        • Vertical

          As for horizontal flipping, but flips vertically, top to bottom.

      • Rotate

        Brings up a submenu for rotating the grid. Note: These operations can only be performed on graphics with a square data format (such as 8x8 pixels, or 16x16 pixels).

        • 90° Left

          Rotates the whole grid 90 degrees anti-clockwise. As with flipping, this means that not only will each graphic be moved, but characters will assume the data of other characters as they are moved into place.

        • 90° Right

          Rotates the whole grid 90 degrees clockwise. Operates the same way as the 90° Left option, in that the whole grid is rotated.

      • Shift

        Brings up a submenu which gives options for scrolling the grid, with wraparound.

        • Left

          Shifts the grid left by one pixel. Graphics will overflow into one-another at their edges.

        • Right

          Shifts the grid right by one pixel. As with all shift operations, graphics will overflow at their edges.

        • Up

          Shifts the whole grid up one pixel, wrapping around at the bottom of the grid.

        • Down

          Shifts the grid down one pixel, wrapping round at the top.

    • Characters

      Provides tools for working with the individually selected (highlighted) graphic in the palette to the right of the window. Many of these operations are similar to the ones for the editing grid, but work in subtly different ways.

      • Cut

        Stores a copy of the current image on the Graphic Editor clipboard, and clears the current character from the editing grid.

      • Copy

        Stores a copy of the current graphic on the Graphic Editor clipboard.

      • Paste

        Retrieves any graphic stored on the Graphic Editor clipboard, and sends it to the currently selected graphic slot, replacing any graphic that is already there.

      • Insert New

        Inserts a new blank graphic at the currently highlighted position.

      • Delete

        Removes the currently selected graphic. This will reduce the number of graphics available in the palette by 1.

      • Clear

        Clears the currently selected graphic to a blank sheet.

      • Invert

        Swaps the set or un-set state of every pixel in the Editing Grid, thus inverting the character.

      • Flip

        Brings up a submenu which allows you to flip the currently selected graphic.

        • Horizontal

          Flips the current character in the vertical plane.

        • Vertical

          Flips the current character in the horizontal plane.

      • Rotate

        Brings up a submenu which allows you to rotate the character by 90 degrees.

        • 90° Left

          Rotates the current character 90 degrees anti-clockwise.

        • 90° Right

          Rotates the current character 90 degrees clockwise.

      • Shift

        Brings up a submenu, with four options for shifting the current character around the Editing Grid.

        • Left

          Shifts all pixels one place to the left, with wraparound.

        • Right

          Shifts all pixels one place to the right, with wraparound.

        • Up

          Shifts all pixels up one place, with wraparound.

        • Down

          Shifts all pixels down one place, with wraparound.