I’ve started creating a virtual object manager, and it has already required a lot of work, with the help of AI for repetitive tasks and some minor things. There’s already quite a bit of code to manage, so I’ve split it into different files, and even then, it’s not always easy.
The purpose of this code is to create virtual objects, manipulate them, assign values to them, and also retrieve those values. The code is too long, so it’s available for free download.
It’s all well-documented in both French and English!
It’s not yet 100% complete, but it’s already pretty good.
Some functions are not yet usable and don’t serve any purpose right now, but they will later.
This code is probably not very optimized, but I’m open to improvements and additions.
Why am I doing this?
I have a project to recreate a very small Editors Factory , which will be called Visual Object Manager or something like that. I’ll do it all by myself with my own means, with the help of AI and anyone who wants to contribute, and it will use this module.
I want to separate things: a Data (Virtual) part and a Real (Visual) part. The visual side will manipulate data (objects).
I’m not very skilled at coding; I do what I can. It’s not easy, especially with many files and lots of code.
And I’m not claiming that I’ll recreate Editors Factory —no, impossible! But I’ll try to recreate a small part of it, and we’ll see how far I can go.
I’ll try to handle the creation, display, movement, and resizing of objects, but even that will be quite difficult.
But before that, I want to fine-tune this module and make it optimal and complete. Plus, this module could be reused by others or by me in other projects!
Feel free to share your thoughts.
Later, I might consider putting a document online so that some people can improve the code, give feedback, etc. That could be pretty cool, right?
Some function names, not all of them !:
Code: Select all
; Checks if an object exists in the Map.
Procedure.b IsObject(ObjectNumber.i)
; Creates a new object.
Procedure.i CreateObject(ObjectNumber.i, X.i, Y.i, Width.i, Height.i)
; Creates a random object name.
Procedure.s CreateRandomObjectName()
; Deletes an object if it exists.
Procedure.b DeleteObject(ObjectNumber.i)
; Selects the object.
Procedure.b SelectObject(ObjectNumber.i)
; Unselects the object.
Procedure.b UnselectObject(ObjectNumber.i)
; Disables the object.
Procedure.b DisableObject(ObjectNumber.i)
; Enables the object.
Procedure.b EnableObject(ObjectNumber.i)
; Hides the object.
Procedure.b HideObject(ObjectNumber.i)
; Shows the object.
Procedure.b ShowObject(ObjectNumber.i)
; Returns the number of objects that have been created.
Procedure.i CountObject()
; Examines or reexamines all objects from the beginning of the object list (system).
Procedure.i ExamineObjects()
; Moves the pointer one position forward in the object list and returns the next object number.
Procedure.i NextObject()
Code: Select all
; Gets the type of the object.
Procedure.s GetObjectType(ObjectNumber.i)
; Gets the name of the object.
Procedure.s GetObjectName(ObjectNumber.i)
; Returns the unique identifier of the object.
Procedure.i GetObjectID(ObjectNumber.i)
; Gets the X position of the object.
Procedure.i GetObjectX(ObjectNumber.i)
; Gets the Y position of the object.
Procedure.i GetObjectY(ObjectNumber.i)
; Gets the mouse X position on the object.
Procedure.i GetObjectMouseX(ObjectNumber.i)
; Gets the mouse Y position on the object.
Procedure.i GetObjectMouseY(ObjectNumber.i)
; Gets the width of the object.
Procedure.i GetObjectWidth(ObjectNumber.i)
; Gets the height of the object.
Procedure.i GetObjectHeight(ObjectNumber.i)
Code: Select all
; Sets the name of the object.
Procedure.b SetObjectName(ObjectNumber.i, Name.s)
; Sets the type of the object.
Procedure.b SetObjectType(ObjectNumber.i, Type.s)
; Sets the X position of the object.
Procedure.b SetObjectX(ObjectNumber.i, X.i)
; Sets the Y position of the object.
Procedure.b SetObjectY(ObjectNumber.i, Y.i)
; Sets the mouse X position on the object.
Procedure.b SetObjectMouseX(ObjectNumber.i, MouseX.i)
; Sets the mouse Y position on the object.
Procedure.b SetObjectMouseY(ObjectNumber.i, MouseY.i)
; Sets the width of the object.
Procedure.b SetObjectWidth(ObjectNumber.i, Width.i)
; Sets the height of the object.
Procedure.b SetObjectHeight(ObjectNumber.i, Height.i)
Link:
https://drive.google.com/file/d/188eVap ... sp=sharing