Questions tagged [constructor]

A special type of subroutine called at the creation of an object.

4 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
0answers
150 views

2d game enemy entities factories, probably in need of refactoring

So I'm making a 2d shoot'em up game as a way of learning canvas, and larger-scale programming than what I'm accustomed to. I'm a purely front-end web dev, I can't say I'm very experienced in this. ...
2
votes
0answers
50 views

Convenient way to make an UIImageView ExpressibleByStringLiteral

I want to reduce boiler-plate code and write like this when developing in iOS: let imgView: UIImageView = "share_fareware_text_bg" Here is implementation code: <...
2
votes
0answers
582 views

OpenGL Shape class constructor

I'm coding a wrapper for OpenGL 3.3, and I have some questions about the design of my Shape class. To be short, It's a class that englobes a VBO, a VAO, and an EBO ...
2
votes
0answers
269 views

handle drag and drop operations

I've come up with the following code to handle drag and drop operation. It's composed of a constructor function that returns an objects with methods to attach to event handlers. Notes about this ...