The task: to prepare (draw in memory) an array of pictures ("characters of your font"), then to display them on the Canvas in different places, overlaying them on the background (which also changes dynamically). How to draw them in memory? How then to place them on the Canvas? As an example.
1 answer
Read about ArrayList https://habrahabr.ru/post/128269/
HashMap https://habrahabr.ru/post/128017/
In fact, the problem has several solutions. You can store as the pictures themselves, then we will dance from a line like this:
ArrayList<PaintObject> list = new ArrayList<PaintObject>(); Or this, if the pictures will be inserted according to certain rules:
Map<Key,PaintObject> list = new Map<>(Key,PaintObjec); And links to pictures that are simply stored as separate files, then it will be an array of strings or objects based on its class, where the string and key will be stored. In any case, there is plenty of information on organizing an array, you just need to choose whether it will be a HashMap, Map, ArrayList or something else. It is important not only storage - it is also important what methods of processing this array will be. Do I need a search? Random insertion or by some rules? Adding new items to an array? The question is a bit vague, the right organization in one case will be wrong in the other. But as far as I understood, the Map is quite suitable.
ZY Game Balda what?))))
- If the array consists of unique images - you can still Set to use. - FoeNicks
- Drawings ("characters", "new font") are created in memory, and not loaded as files. They are created at the beginning of work (in memory as an array of pictures) and then simply used as "new fonts". - kaaa
- TreeMap I think that will be the most. In either case, there will be a pair of key-letter-object-figure. You can read how to organize here. quizful.net/post/Java-TreeMap - FoeNicks
Paintis not a picture. - Vladyslav Matviienko