Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

When will we be able to change console font and color for Windows
Started by chris9688 Mar 18 2019 11:51 PM

- - - - -
5 replies to this topic

Best Answer thomas6 , 20 March 2019 - 05:06 AM

A bit off topic but: I have my own "console" running on top of my app in its own displayGroup, and I have to say this works really well for me:

 

- I can choose which message I print and which I don't want to see

- I can clear the debug screen easily

- I can mix permanently displayed info (like texture memory usage) with temporary info (line statements) etc...

- I can display my info in a variety of forms

- All this running in my device display

 

I know this only touches upon your question very indirectly, but if you're looking for "better" console functionality, it's worth looking into rolling your own...

[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

chris9688

[GLOBAL: userInfoPane.html]
chris9688
  • Observer

  • 2 posts
  • Corona SDK

https://forums.coronalabs.com/topic/69466-edit-debug-console-font-size-and-colour/

 

I saw this post for changing font size and color, but it is for Mac only, I was wondering when we will be able to do it for Windows too.

 

Thank you



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,660 posts
  • Enterprise

That's not a feature that's high on our list of things to do. This honestly would be a great addition for programmers interested in contributing to Corona's core code since it's now open source!

 

PS and welcome to our wonderful Corona community!

 

Rob



[TOPIC: post.html]
#3

thomas6

[GLOBAL: userInfoPane.html]
thomas6
  • Contributor

  • 961 posts
  • Corona SDK

  Best Answer

A bit off topic but: I have my own "console" running on top of my app in its own displayGroup, and I have to say this works really well for me:

 

- I can choose which message I print and which I don't want to see

- I can clear the debug screen easily

- I can mix permanently displayed info (like texture memory usage) with temporary info (line statements) etc...

- I can display my info in a variety of forms

- All this running in my device display

 

I know this only touches upon your question very indirectly, but if you're looking for "better" console functionality, it's worth looking into rolling your own...


  • chris9688 likes this

[TOPIC: post.html]
#4

chris9688

[GLOBAL: userInfoPane.html]
chris9688
  • Observer

  • 2 posts
  • Corona SDK

Sounds very interesting.

Thanks for the info!



[TOPIC: post.html]
#5

thomas6

[GLOBAL: userInfoPane.html]
thomas6
  • Contributor

  • 961 posts
  • Corona SDK

If you want, feel free to use my code:

--------------------------
-- appDebuggerClass.lua --
--------------------------

local appDebuggerClass = {}

appDebuggerClass.new = function(super, targetDisplayGroup)

	self = {}
	self.type = "appDebugger"
	self.super = super -- super is of type appEngine (game or editor)

	self.mainGroup = display.newGroup()
    self.mainGroup.name = "appDebugger mainGroup named inside appDebugger class"
    self.mainGroup.alpha = .25

	self.currentVerticalPosition = 16
	self.fontSize = 32
	self.lineHeight = 32

	self.addLine = function(lineText)

		local lineOptions = {
			parent = self.mainGroup,
			text = lineText,
			x = 16,
			y = self.currentVerticalPosition,
			font = native.systemFontBold,
			fontSize = self.fontSize,
			align = "left"
			}

		local textLine = display.newText(lineOptions)
		textLine.anchorY = 0
		textLine.anchorX = 0
		--textLine:setFillColor(0,0,0) -- black text!
		textLine:setFillColor(0,1,0) -- green text!

		if self.currentVerticalPosition < 1400 then
			self.currentVerticalPosition = self.currentVerticalPosition + self.lineHeight
		else
			self.currentVerticalPosition = self.currentVerticalPosition + self.lineHeight
			self.mainGroup.y = self.mainGroup.y - self.lineHeight
		end			

	end -- self.addTitle()

	self.clearDebugger = function()

		for i = self.mainGroup.numChildren, 1, -1 do
			self.mainGroup[i]:removeSelf()
		end

		self.mainGroup.y = 0
		self.currentVerticalPosition = 16

	end -- self.clearDebugger()

	self.countDisplayObjects = function()

		local mainStage = display.getCurrentStage()
		self.addLine(" ")
		self.addLine("***--- COUNT DISPLAYOBJECTS ---***")
		self.addLine("mainStage has "..mainStage.numChildren.." children")

		for i = 1, mainStage.numChildren do
			local childType = ""
			if mainStage[i].numChildren == nil then
				childType = "displayObject, no group"
			else
				childType = "group with "..mainStage[i].numChildren.." children"
			end

			local groupName = ""
			if mainStage[i].name then
				groupName = mainStage[i].name
			else
				groupName = "no name!"
			end

			self.addLine("Child "..i.." type = "..childType.." ( name = "..groupName.." )")
		end 


	end -- self.countDisplayObjects()

	-- insert own objects into own mainGroup

	-- insert own mainGroup into targetDisplayGroup!
	targetDisplayGroup:insert(self.mainGroup)

	return self

end -- appDebuggerClass.new()

return appDebuggerClass


[TOPIC: post.html]
#6

thomas6

[GLOBAL: userInfoPane.html]
thomas6
  • Contributor

  • 961 posts
  • Corona SDK

FYI, the code above let's you output lines of text that appear in a displayGroup of your choosing.

 

It's best to create a displayGroup at the very "top" of your screen stack, and pass this displayGroup as a parameter to the appDebugger class.

 

The "super" parameter is meant to be the parent object of this appDebugger. If you don't want to use this just delete that code from this class.

 

Then there's two methods that are handy: self.clearDebugger which empties the screen, and self.countDisplayObjects which counts the number of displayObjects or displayGroups on the "most top" level, which is the currentStage. This is handy to see if you've cleaned up everything on screen or not.




[topic_controls]
[/topic_controls]