When you're calling functions you want to use 'this'
.
If there's no current object, 'this
' refers to the global object. In a web browser, that’s ‘window
’ — the top-level object, which represents the document, location, history and a few other useful properties and methods.
‘this
’ remains the global object if you’re calling a function:
So therefore, this.userInitials()
will work:
this.font.draw(this.userInitials(), ig.system.width/2, 95, ig.Font.ALIGN.CENTER);