instanced Sprites get scaled unwantingly

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Nazzaroth

Original Question (for new situation see below edit):

Hello everyone

sorry if this problem is asked already but im doing a gamejam right now
and have not so much time to research but the 45min of google and this site
didnt turn up an answer.

so im trying to recreate a chessboard programatically adding the seperate spaces
to a node2d field.

my window settings in projektsettings is 720-720
the textures of my individual spaces (im using animated sprite node to change between
black and white texture) are both 90-90 so it should perfectly fill out the view in
a 8x8 grid, but it doesnt

setup code looks like this:

func _fieldSetup():
	for i in range(1,9):
		for j in range(1,9):
			var space = spaceScene.instance()
			
			#debug print
			print(get_viewport().get_visible_rect().size)
			print(OS.get_window_size())
			print(space.get_child(0).get_sprite_frames().get_frame("black",0).get_size())
			
			#set properties of space depending on grid indicies
			space.name = self._namingFunc(i,j)
			space.position = self._positionFunc(i,j)
			var animation = self._animationFunc(i,j)
			space.get_child(0).set_animation(animation)
			
			self.add_child(space)

the positionFunc goes from 45,675 in x+45 steps to the right
and every 8 spaces goes y-45 steps upwards.

output:
(720, 720)
(90,90)

but the field is only one part of the resulting window instead of filling out
the whole window.
also using streching options in settings doesnt change anything.

just noticed while doing the screenshot that the window is definitly
bigger than 720x720 pixels. any idea why that is and how to change it?

what am i doing wrong here?

EDIT:
poked around a bit.
now im not using animatedSprite but just a few spritenodes and changing
visibility of them and after instancing the spaces manually through the
editior i notice that they look way bigger than when using code to instancing.

so my guess is that the spriteTextures get scaled when instanced through code.

no idea though why and how to keep godot from doing this.

What is the value of Transform->Scale for your Sprite nodes, or the parent nodes to the Sprites?

Eric Ellingson | 2019-08-03 15:47

both the tiles and the field have a scale of (1,1)

I fixed this for now by handplacing all 64 tiles in the field scene and
renaming/setting color by hand but i still think it would be all cleaner
doing it in code (especially for other games when i want to change how the
field is getting setup)

Nazzaroth | 2019-08-04 15:21