Type AngelFont not found

Monkey Forums/Monkey Beginners/Type AngelFont not found

SirRollon(Posted 2014) [#1]
Hi again,

Here is the code of AngelFontExample that I modified with a
main Class : "myApp" that call OnCreate, OnUpdate, OnRender for the other Classes (right now there is only one of them, but I'll add the other later, when I'll be able to make this one work with your help).

I have a message :
"Type AngelFont not found".
when I compile
watch for the comment 'HERE IS THE ERROR -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

Can anyone tell me how to solve this problem ?


'Import reflection

Import mojo

Import angelfont
Import simpleinput
Import simpletextbox

Global theApp:MyApp

Class MyApp Extends App
	
	Field text1:AngelFontExample
	
	Method OnCreate()
	
		texte1 = New AngelFontExample
		texte1.OnCreate()
		
	End
	
	Method OnUpdate()
	
		texte1.OnUpdate()
	
	End
	
	Method OnRender()
	
		texte1.OnRender()
		
	End
	
End Class

Class AngelFontExample 

	Field font:AngelFont
	
	Field inp:SimpleInput
	
	Field textBoxText:String
	
	Method OnCreate()
		SetUpdateRate 30
		
		EnableKeyboard
		
'HERE IS THE ERROR -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
		font = New AngelFont()

		font.italicSkew = 0.15
		
		'font.LoadFont("angel3")			'deprecated
		'font.LoadFont("angel_verdana")		'deprecated		
		
'		font.LoadFontXml("angel_verdana")		' single font texture 'page'
		font.LoadFontXml("pagedfont")			' multiple font texture 'pages'
		
		
		inp = New SimpleInput("simple input")
		
'		textBoxText = LoadString("simpletextboxtext.txt")
		textBoxText = "You will notice you are unable to move. Your only ability is the ninjah rope for this level. At the bottom right of the screen you will see three ability icons. Move, lets you move left and right. Rope, lets you use your ninjah rope. Gun, lets you boost."
'		textBoxText = LoadString("simpletextboxhtml.txt")
		
	End

	Method OnUpdate()
		
		inp.Update()
	End
	
	Method OnRender()
		
		Cls 80,80,80
		
		'font.DrawText("Testing angel fonts", DeviceWidth/2,5, AngelFont.ALIGN_CENTER)		
		font.DrawHTML("Testing angel fonts <i>Italic</i> <b>Bold <i>Both</i></b>", 5,5)		
		
		SetColor 255,255,50
		inp.Draw(5,45)
		
'		SimpleTextBox.Draw(textBoxText,5,75,630)
'		SimpleTextBox.Draw(textBoxText,DeviceWidth()/2,75,630, AngelFont.ALIGN_CENTER)

		PushMatrix()
			Scale 0.75,0.75
'			SimpleTextBox.Draw(textBoxText,DeviceWidth(),180,1260, AngelFont.ALIGN_CENTER)
			SimpleTextBox.DrawHTML(textBoxText,426,180,832, AngelFont.ALIGN_CENTER)
'			SimpleTextBox.DrawHTML(textBoxText,0,180,480)	', AngelFont.ALIGN_CENTER)
		PopMatrix()

	End

	
End

Function Main()
	theApp = New MyApp()
	
End



Beaker(Posted 2014) [#2]
Do you have the angelfont.monkey, char.monkey etc files in your project folder?


Pierrou(Posted 2014) [#3]
Bienvenue!
I've noticed that the text1 field (Field text1:AngelFontExample) is labeled "texte1" everywhere else.


SirRollon(Posted 2014) [#4]
Pierrou got the answer !
I triple check everything and I still stuck on ONE letter.
I'm learning to be perfect with code !

Merci


Pierrou(Posted 2014) [#5]
For myself, I'm using Jungle IDE which automatically detects that kind of misspellings and other various syntax errors on the fly. It can prevent some headaches and is really worth its price. I know a few other IDEs are available too. Also have you seen that there's a French/French speaking topic somewhere on theses forums?


SirRollon(Posted 2014) [#6]
Are you using the free version of Jungle ? Is it good ?
And I've not seen the French speaking topic.


Pierrou(Posted 2014) [#7]
The French speaking topic:
http://www.monkey-x.com/Community/posts.php?topic=5988

I bought a lifetime Jungle License shortly after I bought Monkey and I really couldn't go back to Ted now.
Jungle Lite/ Jungle IDE features here : http://www.jungleide.com/?page_id=5171


Beaker(Posted 2014) [#8]
You can also put the Strict compiler directive at the beginning of your code. But you would then need to change "Method OnCreate()" to "Method OnCreate:Int()" etc and put Returns in each of the standard Mojo methods: OnCreate, OnUpdate, OnRender etc.